View gist:5a737e07de31b212c0887b23c89a7568
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' {} + |
View gist:bf25af067a46833c30c095d11830d857
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 |
View main.py
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') |
View gist:014ad6d6aec2f4eff687bf13179363ba
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' |
View visit-frequency.py
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 = [] |
View gist:5648efbe3e504c263610dc0db34e0089
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
# Regex to count paths with 4 slashes | |
(\/[^\/]*){4} | |
# Regex to count paths with starting text | |
\/issues(\/[^\/]*){3} |
View word-frequency.py
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 re | |
words = re.findall(r'\w+', open('term-list.csv').read().lower()) | |
counts = Counter(words).most_common(500) |
View gist:58c3c40a24518d6c7e3e106004c6c4f5
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
{ | |
"keywords": [ | |
{ | |
"text": "natural gas", | |
"relevance": 0.957925 | |
}, | |
{ | |
"text": "natural gas meters", | |
"relevance": 0.832745 | |
}, |
View gist:1e734234d55f39bc3e151ce3afeac899
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 |
View gist:7e06ea29c077ef33badf
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
// removes WordPress inline style width on captions | |
add_filter( 'img_caption_shortcode_width', '__return_zero' ); |
NewerOlder