This file contains hidden or 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 | |
function api_pull($url) { | |
$API_object = file_get_contents($url); | |
$array = json_decode($API_object, TRUE); | |
return $array; | |
} | |
$now = time(); |
This file contains hidden or 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 | |
//returns a big old hunk of JSON from a non-private IG account page. | |
function scrape_insta($username) { | |
$insta_source = file_get_contents('http://instagram.com/'.$username); | |
$shards = explode('window._sharedData = ', $insta_source); | |
$insta_json = explode(';</script>', $shards[1]); | |
$insta_array = json_decode($insta_json[0], TRUE); | |
return $insta_array; | |
} |
This file contains hidden or 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
#!/usr/bin/python | |
from bs4 import BeautifulSoup #you will probably have to install this: http://www.crummy.com/software/BeautifulSoup/ | |
import urllib2 | |
import sys | |
import cgitb | |
import string | |
import json | |
#This takes a URL and turns it into BeautifulSoup object |
This file contains hidden or 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 | |
function fix_file($source) { | |
$problems = array( | |
"/(<trkpt.*)\/>/", | |
"/<\/trkseg>\s*<trkseg>/" | |
); | |
$fixes = array( | |
"$1></trkpt>", |
This file contains hidden or 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
$unit: 6px; /*scalable*/ | |
$ship-axis: 16; /*for humans*/ | |
/*colors*/ | |
$teal: teal; | |
$orange: orange; | |
$yellow: yellow; | |
$blue: blue; | |
$purple: magenta; //i kno wtf | |
$pink: purple; //lol |
This file contains hidden or 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
[^a-z,A-Z,0-9,\<,\>,\?,\.,\,,\",\",\',\=,\-,\_,\:,\/,\|,\s] |
This file contains hidden or 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
hello() { | |
echo "Hello, $1" | |
} | |
# % hello world | |
# outputs | |
# Hello, world | |
twoParams() { | |
echo "$1, $2" |