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 | |
// parameters | |
$hubVerifyToken = 'TOKEN123456abcd'; | |
$accessToken = "xxx"; | |
// check token at setup | |
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) { | |
echo $_REQUEST['hub_challenge']; | |
exit; | |
} |
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 | |
$bg_img='bg.jpg'; //path to background (JPG ext) | |
$logo_img='logo.png'; // path to logo (PNG ext.) | |
list($width_of_bg, $height_of_bg) = getimagesize($bg_img); // to calculate background image width and height | |
list($width_of_logo, $height_of_logo) = getimagesize($logo_img); //to calculate logo image width and height | |
//for bottom right | |
$logo_loc_width=$width_of_bg-$width_of_logo; | |
$logo_loc_height=$height_of_bg-$height_of_logo; |
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
Step 1: | |
Go to: C:\Windows\System32\Drivers\etc\hosts | |
And add this to the bottom of the file: | |
============= | |
127.0.0.1 your.domain.com | |
============= | |
Step 2: | |
Go to [your XAMPP directory]/apache/conf/httpd-xampp.conf |
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
// This example displays an address form, using the autocomplete feature | |
// of the Google Places API to help users fill in the information. | |
$("#autocomplete").on('focus', function () { | |
geolocate(); | |
}); | |
var placeSearch, autocomplete; | |
var componentForm = { | |
street_number: 'short_name', |
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
BFS(source, goal): | |
queue = empty new queue | |
queue.add(source) | |
if current == goal: | |
return path | |
if current in visited: | |
continue | |
visited.add(current) | |
for direction, neighbour in graph[current]: | |
queue.append((path + direction, neighbour)) |
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 | |
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html | |
$url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json'; | |
$file= file_get_contents($url); | |
$json = json_decode($file); | |
$rows = $json->{'feed'}->{'entry'}; | |
foreach($rows as $row) { | |
echo '<p>'; |
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
from bs4 import BeautifulSoup | |
import urllib | |
import csv | |
def innerHTML(element): | |
return element.decode_contents(formatter="html") | |
def get_name(body): | |
return body.find('span', {'class':'jcn'}).a.string |
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
import time | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
#driver = webdriver.Firefox() | |
driver = webdriver.Chrome() | |
driver.get("http://web.whatsapp.com/") |
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
{ | |
"type": "label", | |
"text": "refresh", | |
"action": { | |
"type": "$network.request", | |
"options": { | |
"url": "https://jasonbase.com/things/jYJ.json" | |
}, | |
"success": { | |
"type": "$render" |
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
{ | |
"$jason": { | |
"head": { | |
"title": "Twitter", | |
"styles": { | |
"note": { | |
"color": "#ffffff", | |
"font": "HelveticaNeue-Bold", | |
"size": "15" | |
} |
OlderNewer