This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dates = document.getElementsByClassName("date"); | |
var totalTime = '00:00:00'; | |
for(var i=0;i<dates.length;i++) { | |
totalTime = formatTime(timestrToSec(totalTime) + timestrToSec('00:'+dates[i].innerText)); | |
} | |
console.log("Total Time: "+totalTime); | |
function timestrToSec(timestr) { | |
var parts = timestr.split(":"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$video_url = $_GET['video_url']; | |
echo get_fb_thumbnail($video_url); | |
function get_fb_thumbnail($video_url) { | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => $video_url, | |
CURLOPT_RETURNTRANSFER => true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$attack = "<script>alert('boom');</script>"; | |
$sanitized = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $attack); | |
echo $sanitized; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Image Coordinates Generator</title> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<meta name="robots" content="noindex, nofollow"> | |
<meta name="googlebot" content="noindex, nofollow"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Johor": [ | |
{ | |
"city": "Ayer Baloi", | |
"zip": "82100", | |
"lat": 1.587094, | |
"lng": 103.339187 | |
}, | |
{ | |
"city": "Ayer Hitam", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
Head over to developer.facebook.com and create an App
On your server, create a facebook webhook that will handle facebook calls. Then create a "leadgen" webhook on you App: https://developers.facebook.com/docs/graph-api/webhooks/v2.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
HISTOGRAM EQUALIZATION CALCULATOR | |
Afif Zafri | |
''' | |
from collections import Counter | |
# input | |
gray = [60,7,60,8,60,10,7,30, | |
30,45,15,15,7,15,60,8, |
NewerOlder