Skip to content

Instantly share code, notes, and snippets.

View dvcrn's full-sized avatar
💫

David dvcrn

💫
View GitHub Profile
@dvcrn
dvcrn / gist:3847689
Created October 7, 2012 09:43
Parse twitter urls, hashtags and usernames
parse_tweet = function (str) {
var create_link = function (url, text) {
var link = $("<a>", {
text: text,
href: url,
target: "_blank"
});
return link.prop('outerHTML');
};
@dvcrn
dvcrn / sina.py
Created September 25, 2012 03:05
Bing download url crawler
from pybing import Bing
from urllib2 import HTTPError
from BeautifulSoup import BeautifulSoup
from pybing import constants
import re
import mechanize
import simplejson
searchstring = "cows" # your search string here
searchcount = 40
@dvcrn
dvcrn / gist:95b42a5c7c61860ea2af
Created June 16, 2015 16:15
Launch Emacs.app or create a new window if already running
emacs () {
PROCESS=Emacs
number=$(ps aux | grep $PROCESS | wc -l)
if [ $number -gt 1 ]
then
emacsclient -c -n $1
else
open -a /usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.8/Emacs.app $1
fi
@dvcrn
dvcrn / proxmate.me s3 prerender
Created March 16, 2014 16:31
prerender script used for generating static pages for proxmate.me.
fs = require 'fs'
webpage = require 'webpage'
page = webpage.create()
renderedUrls = 0
totalUrls = 0
# Taken from https://github.com/ariya/phantomjs/blob/master/examples/waitfor.js
# Converted into coffee
waitFor = (testFx, onReady, timeOutMillis) ->
maxtimeOutMillis = (if timeOutMillis then timeOutMillis else 5000) #< Default Max Timout is 3s