Skip to content

Instantly share code, notes, and snippets.

View jedahan's full-sized avatar
💀
.

Jonathan Dahan jedahan

💀
.
View GitHub Profile
@jedahan
jedahan / yt-csv.sh
Created April 28, 2014 16:08
yt-csv
# Make dir with timestamp and go there
folder=$(date +%H%M%S)
mkdir $folder && cd $folder
# YTDL scrape from this .csv
youtube-dl \
-a /Users/scottleinweber/Dropbox/SFPC/Day6_Sat_AlexHacks/AllVideos/data/allvideos_urlonly.csv \
-i —write-thumbnail /Users/scottleinweber/Dropbox/SFPC/Day7_Videoscrape/AllVideos/thumbs \
--no-warnings \
--skip-download \
@jedahan
jedahan / 3ds.html
Created April 29, 2014 17:22
3ds centric html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=400">
<style>
body{margin:0px;}
#topscreen{width:400px;height:220px;overflow:hidden;}
#bottomscreen{width:320px;height:212px;overflow:hidden;margin:0 auto;}
</style>
<script type="text/javascript">
@jedahan
jedahan / filtering.js
Created April 29, 2014 22:21
filtering a gallery
var isNumberLess = function(text){
return ! /[0-9]+/.test(text);
}
var all_paragraphs = $('.checklist-desc > p');
for(int i=0; i<all_paragraphs.length; i++){
var filtered = all_paragraphs[i].textContent.split('\n').filter(isNumberLess);
console.log(filtered[filtered.length-1]+',');
}
@jedahan
jedahan / yo.coffee
Created April 30, 2014 15:59
scrape google
casper = require("casper").create
logLevel: "debug"
casper.start "https://www.google.com/", ->
@test.assertTitle "Google", "google homepage title is the one expected"
@test.assertExists 'form[action="/search"]', "main form is found"
@fill 'form[action="/search"]', q: "foo", true
casper.then ->
console.log @fetchText("span.st")
var addMore = function(ev) {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
// you're at the bottom of the page
var div = document.createElement('div')
div.setAttribute("style", "font-family: sans-serif; font-size: 500%;")
div.innerHTML = "POLARIZING. MERCURIAL. FORCEFUL. FEARELESS. TALENTED. STUBBORN. CONDESCENDING. DIFFICULT. UNREASONABLE. IMPOSSIBLE. DISENGAGED. UNCARING. UNPOPULAR. PUSHY. HARD. BRUSQUE."
document.body.appendChild(div)
}
}
window.onscroll = addMore;
@jedahan
jedahan / woah.zsh
Last active August 29, 2015 14:01
precmd for seeing if we should show push or pull arrows in the prompt
command git rev-parse --abbrev-ref @'{u}' &>/dev/null && {
local arrows=""
(( $(command git rev-list --right-only --count HEAD...@'{u}' 2>/dev/null) > 0 )) && arrows="⇡"
(( $(command git rev-list --left-only --count HEAD...@'{u}' 2>/dev/null) > 0 )) && arrows+="⇣"
print -Pn "\e7\e[A\e[1G\e[`prompt_pure_string_length $prompt_pure_preprompt`C%F{cyan}${arrows}%f\e8"
}
@jedahan
jedahan / howto-generator.coffee
Created May 20, 2014 19:15
I have no idea how to use generators, eh...
q = require 'q'
request = q.denodeify require 'request'
xml2js = require 'xml2js'
parser = new xml2js.Parser()
parseString = q.denodeify parser.parseString
api = "http://www.metmuseum.org/collection/the-collection-online/search"
getEndpoint = (endpoint) ->

Keybase proof

I hereby claim:

  • I am jedahan on github.
  • I am jedahan (https://keybase.io/jedahan) on keybase.
  • I have a public key whose fingerprint is 4EAA C83C 423C 57A5 47F8 2683 4819 8564 E673 4396

To claim this, I am signing this object:

Compiling chromaStatus for Release
checking pkg-config libraries: cairo zlib gstreamer-app-0.10 gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-2.0 libmpg123
make[1]: Entering directory `/home/jedahan/of_v0.8.1_linux64_release/apps/devartRecorder/chromaStatus'
Compiling src/testApp.cpp
g++ -c -Os -Wall -march=native -mtune=native -DOF_USING_GTK -DOF_USING_MPG123 -I./src -I./src/lame -I./src/lame/include -I./src/lame/include/lame -I./src/libmpg -I./src/curl -I./src/vamp-sdk -I./src/vamp-hostsdk -I./src/chroma -I./src/vamp -I./src/fftw -I./chromaStatus.xcodeproj/xcshareddata -I./chromaStatus.xcodeproj/xcshareddata/xcschemes -pthread -D_REENTRANT -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gstreamer-0.10 -I/usr/include/libxml2 -I/usr/include/alsa -I/usr/include/GL -I/usr/include/gtk
jedahan@devartyoyo:~/of_v0.8.1_linux64_release/apps/devartRecorder/chromaStatus$ make
checking pkg-config libraries: cairo zlib gstreamer-app-0.10 gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-2.0 libmpg123
Compiling OF library for Release
checking pkg-config libraries: cairo zlib gstreamer-app-0.10 gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-2.0 libmpg123
make[1]: Entering directory `/home/jedahan/of_v0.8.1_linux64_release/libs/openFrameworksCompiled/project'
checking pkg-config libraries: cairo zlib gstreamer-app-0.10 gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-2.0 libmpg123
make[2]: Nothing to be done for `ReleaseABI'.
checking pkg-config libraries: cairo zlib gstreamer-app-0.10 gstreamer-0.10 gstrea