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
function appendHtml(el, str) { | |
var div = document.createElement('div'); | |
div.innerHTML = str; | |
while(div.children.length > 0) { | |
el.appendChild(div.children[0]); | |
} | |
} | |
var html = ` | |
<style> |
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
!function() { | |
// Fetch extension URLs and metadata | |
let xhttp = new XMLHttpRequest() | |
xhttp.onreadystatechange = function() { | |
if(this.readyState == 4 && this.status == 200) { | |
app(xhttp.responseText) | |
} | |
} | |
xhttp.open("GET", "https://api.jsonbin.io/b/5ada3145a8095e28cb0abcc3/12", true) | |
xhttp.send() |
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
SELECT | |
* | |
FROM | |
[bigquery-public-data:hacker_news.full] | |
WHERE | |
type="comment" AND (REGEXP_MATCH(text,r'.*amazon.*\/\d{9}.*') OR (text like '% am reading %' OR text like '% was reading %' OR text like '% just finished %' OR text like '% finished reading %' OR text like '% just read %' OR text like '% going to read %' OR text like '% about to read %')) | |
LIMIT | |
50000 | |
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
const isEmpty = (obj = {}) => Object.keys(obj).length === 0 | |
// via: https://twitter.com/peterpme/status/949352875687202816?ref_src=twcamp%5Eshare%7Ctwsrc%5Em5%7Ctwgr%5Eemail%7Ctwcon%5E7046%7Ctwterm%5E1 |
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
/* Put this inside a "Run JavaScript" action in Automator */ | |
var Safari = Application('Safari'), | |
currentTab = Safari.windows[0].currentTab, | |
executionContext = {in: currentTab}, | |
currentURL = currentTab.url(), | |
mobileURL = 'https://en.m.wiki' + currentURL.split("en.wiki")[1], | |
command = 'window.location="' + mobileURL + '"'; | |
Safari.doJavaScript(command, executionContext) |
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
ffmpeg -i <input.mkv> -map 0:0 -map 0:2 -c copy <output.mp4> | |
# 0:0 is the video stream to be copied as -map syntax is <input no>:<stream no> | |
# 0:1 is the English audio stream, skip this and map 0:2, the Japanese audio stream, to the output. | |
# You can see the stream info with their id by running ffmpeg -i <input.mkv> | |
# BONUS: convert MKV to MP4 right here with this single command |
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 * -type f -name "*(1).mp3" -delete |
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
du -sh */ | sort |
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 . -type f | wc -l |
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
du -hc <*.jpg> | tail -1 | |
#replace <*.jpg> with the desired filter |