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
/* | |
* Bookmarklet for viewing source in iPad Safari | |
*/ | |
javascript:(function(){ | |
var w = window.open('about:blank'), | |
s = w.document; | |
s.write('<!DOCTYPE html><html><head><title>Source of ' + location.href + '</title><meta name="viewport" content="width=device-width" /></head><body></body></html>'); | |
s.close(); | |
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
/* 1 */ | |
(function(factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD | |
define(['jquery'], factory); | |
} else if (typeof module === 'object' && module.exports) { | |
// CommonJS | |
module.exports = factory(require('jquery')); | |
} else { | |
// Browser globals |
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 | |
/* | |
* Converts CSV to JSON | |
* Example uses Google Spreadsheet CSV feed | |
* csvToArray function I think I found on php.net | |
*/ | |
header('Content-type: application/json'); | |
// Set your CSV feed |
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
javascript:(function(){var a=window.open("about:blank").document;a.write("<!DOCTYPE html><html><head><title>Source of "+location.href+'</title><meta name="viewport" content="width=device-width" /></head><body></body></html>');a.close();var b=a.body.appendChild(a.createElement("pre"));b.style.overflow="auto";b.style.whiteSpace="pre-wrap";b.appendChild(a.createTextNode(document.documentElement.innerHTML))})(); |
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 xml.dom import minidom | |
import json | |
config = { | |
'svg_file' : 'map.svg', | |
'js_file' : 'map.js', | |
'js_var' : 'svgMap' | |
} | |
svg = minidom.parse(config['svg_file']) |
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
find . -name '*.html' -exec sed -i '' 's/http:/https:/g' {} + |
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
for f in *.mp4 ; do echo file \'$f\' >> list.txt; done && ffmpeg -f concat -safe 0 -i list.txt -c copy stitched-video.mp4 && rm list.txt | |
# https://stackoverflow.com/questions/28922352/how-can-i-merge-all-the-videos-in-a-folder-to-make-a-single-video-file-using-ffm |
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 pandas as pd | |
from sheets import send_to_sheets | |
df = pd.DataFrame.from_dict(data, orient='index') | |
send_to_sheets(df, 'Optional Sheet 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
curl -u '{API key}:{API secret key}' \ | |
--data 'grant_type=client_credentials' \ | |
'https://api.twitter.com/oauth2/token' |
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
# Main | |
def main(interval): | |
global API | |
API = initialize_analyticsreporting() | |
start_date = datetime.strptime(START_DATE, '%Y-%m-%d').date() | |
end_date = datetime.strptime(END_DATE, '%Y-%m-%d').date() | |
cache = defaultdict(int) | |
counts = [] |
NewerOlder