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
<!-- view random screenshot of a video, without any javascript --> | |
<img src="http://localhost/api/thumb?id=foobar.mp4"> |
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
#add this function to ~/.bashrc or ~/.bash_profile | |
# each time you clone a fork, add the original as 'upstream' | |
# git remote add upstream git://github.com/REPO_ORG/REPO_NAME.git | |
# (thanks https://gist.github.com/CristinaSolana/1885435) | |
# keeps a fork up-to-date from the main repo | |
function update-fork() { | |
git fetch upstream | |
git pull upstream master |
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
errors: | |
key 34.8026083,135.5382721 must not contain '.' | |
Pitt Town, New South Wales - cannot read length, politics/population.js:8 | |
... 1:30pm | |
took 4.6 hours |
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
//add a new content-security-policy to the page | |
function addTag(content){ | |
var meta = document.createElement('meta'); | |
meta.httpEquiv = "Content-Security-Policy"; | |
meta.content = content | |
document.getElementsByTagName('head')[0].appendChild(meta); | |
} | |
//try to add a <script> tag | |
function addScript(src) { |
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
hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgrnerFBSQMUN4kUjy9k/FGTbiIjoZZYxRr2m+kZtoE2UKp3BheWxvYWTFAvp7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTIwYWU3N2FiMTQxNDkwMzE0Mzc4OTE0OGYyZjY0ZmM1MTkzNmUyMjIzYTE5NjU4YzUxYWY2OWJlOTE5YjY4MTM2NTBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwYWU3N2FiMTQxNDkwMzE0Mzc4OTE0OGYyZjY0ZmM1MTkzNmUyMjIzYTE5NjU4YzUxYWY2OWJlOTE5YjY4MTM2NTBhIiwidWlkIjoiYThlMmQ2ZDFlOGE3MmQwMGJkNzExZTZkYWYyMTE5MTkiLCJ1c2VybmFtZSI6InNwZW5jZXJtb3VudGFpbiJ9LCJzZXJ2aWNlIjp7Im5hbWUiOiJnaXRodWIiLCJ1c2VybmFtZSI6InNwZW5jZXJtb3VudGFpbiJ9LCJ0eXBlIjoid2ViX3NlcnZpY2VfYmluZGluZyIsInZlcnNpb24iOjF9LCJjbGllbnQiOnsibmFtZSI6ImtleWJhc2UuaW8gZ28gY2xpZW50IiwidmVyc2lvbiI6IjEuMC4xNyJ9LCJjdGltZSI6MTQ3NTY4MjI0MSwiZXhwaXJlX2luIjo1MDQ1NzYwMDAsIm1lcmtsZV9yb290Ijp7ImN0aW1lIjoxNDc1NjgyMjIwLCJoYXNoIjoiNmYzZDczZWY0M2RhOTIwMmMxMTU1ZjRlNGE2MDg0NDFmNmU4YzU1NzEwZTJhYmVkMmE1ZDk1ZDcyNWE5NGEwZGE1ZmMxNmIxNjFmMWE1OTA1Yzk0NjU3NjA1NWRhZTIxOGNmZTE3MGRmMDAzZWJiYjU1MDRmOWE2NmZiZDBkOGYiLCJzZXFubyI6NjY1MjE1fSwicHJldiI6IjI2Y2YwYzgxNDg0ZDQ4ZGNmZjE5 |
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
[ { count: 2523, text: 'ross' }, | |
{ count: 1922, text: 'joey' }, | |
{ count: 1876, text: 'god' }, | |
{ count: 1411, text: 'rachel' }, | |
{ count: 1348, text: 'guy' }, | |
{ count: 1345, text: 'monica' }, | |
{ count: 991, text: 'chandler' }, | |
{ count: 640, text: 'phoebe' }, | |
{ count: 430, text: 'pheeb' }, | |
{ count: 385, text: 'rach' }, |
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
zgrep -v 'www.w3.org\/1999\/02\/22-rdf-syntax-ns#type\|www.w3.org\/2000\/01\/rdf-schema#label\|music.release\|music.track\|music.recording\|22-rdf-syntax-ns#type\|book.book_edition\|book.isbn\|common.notable_for\|film_crew_gig\|tv.tv_series_episode\|type.namespace\|type.content\|type.permission\|common.topic.notable\|type.object.key\|key\/authority\|type.object.permission\|type.type.instance\|dataworld.freeq\|common.licensed_object' ~/freebase-rdf-latest.gz | sed 's/<http:\/\/rdf\.freebase\.com\/ns\/\([^>]*\)>/\1/g;s/<http:\/\/www\.w3\.org\/[^#]*//g' > ~/much_smaller_dump.tsv |
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
#remove things from contextmenu | |
ban_menus= { | |
"Undo":true | |
"Split Up":true | |
"Correct Spelling":true | |
} | |
atom.contextMenu.itemSets.forEach (o)-> | |
if o.selector.match(/(atom-text-editor|atom-pane)/) | |
if ban_menus[o.items[0].label] || ban_menus[(o.items[1]||{}).label] | |
o.items=[]; |
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
//(Rule-based sentence boundary segmentation) - chop given text into its proper sentences. | |
// Ignore periods/questions/exclamations used in acronyms/abbreviations/numbers, etc. | |
// @spencermountain 2015 MIT | |
var sentence_parser = function(text) { | |
var sentences = []; | |
//first do a greedy-split.. | |
var chunks = text.split(/(\S.+?[.\?!])(?=\s+|$|")/g); | |
//honourifics | |
var abbrevs = ["jr", "mr", "mrs", "ms", "dr", "prof", "sr", "sen", "corp", "rep", "gov", "atty", "supt", "det", "rev", "col", "gen", "lt", "cmdr", "adm", "capt", "sgt", "cpl", "maj", "miss", "misses", "mister", "sir", "esq", "mstr", "phd", "adj", "adv", "asst", "bldg", "brig", "comdr", "hon", "messrs", "mlle", "mme", "op", "ord", "pvt", "reps", "res", "sens", "sfc", "surg"]; | |
//common abbreviations |
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
class Line | |
constructor: (@options)-> | |
if !@options.container | |
@options.container= mainContext | |
@s= new Surface({ | |
size:[0, @options.width||2] | |
properties:{ | |
"background-color":@options.color||"pink" | |
} |