Skip to content

Instantly share code, notes, and snippets.

View houshuang's full-sized avatar

Stian Håklev houshuang

View GitHub Profile
Categories = [
"taking a break", #0 - this is the one to use when stepping away from the computer
"Thesis", #1
"GAship", #2
"IRR", #3
"P2PU", #4
"AVU", #5
"goofing", #6
"project 1", #7
"project 2"] #8 - #9 is reserved for the status message
require 'rubygems'
require 'youtube_g'
require 'pp'
client = YouTubeG::Client.new
allvids = Array.new
count = 1
begin
while true
videos = client.videos_by(:user => 'vu', :page => count)
allvids = allvids + videos.videos
@houshuang
houshuang / hack.sh
Created March 31, 2012 22:13 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@houshuang
houshuang / html.php
Created April 11, 2012 21:22
inc/wiki.php from dokuwiki modified for researchr (http://reganmian.net/wiki/researchr:start)
<?php
/**
* HTML output functions
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <andi@splitbrain.org>
*/
if(!defined('DOKU_INC')) die('meh.');
if(!defined('NL')) define('NL',"\n");
@houshuang
houshuang / html.php
Created April 11, 2012 21:25
function from inc/wiki.php in dokuwiki modified for researchr (http://reganmian.net/wiki/researchr:start)
function html_search(){
global $conf;
global $QUERY;
global $ID;
global $lang;
print '<div class="toc">
<div class="tocheader toctoggle" id="toc__header">Table of Contents</div>
<div id="toc__inside">
@houshuang
houshuang / check-oa.rb
Created April 17, 2012 17:30
Quick API to check if a URL has downloadable PDF - live at http://reganmian.net/check-oa/URL
#!/usr/bin/ruby
require 'net/http'
require "cgi"
# this runs on my server, and is used to check if a certain url links to a publicly available PDF
def checkOA(url)
url = url.gsub("http:/",'').gsub("http://",'')
uri, *path = url.split("/")
path = "/" + path.join("/")
def growl(title,text='')
if text == ''
text = title
title = ''
end
`#{Script_path}/growlnotify -t "#{title}" -m "#{text}"`
end
@houshuang
houshuang / bibtex.tex
Last active December 16, 2015 10:59
Instaparse definition for BibTeX
@article{laurillard2009pedagogical,
Author = {Laurillard, Diana},
Date-Added = {2013-01-18 20:15:33 +0000},
Date-Modified = {2013-01-18 20:15:33 +0000},
Doi = {10.1007/s11412-008-9056-2},
Journal = {International Journal of Computer-Supported Collaborative Learning},
Month = {mar},
Number = {1},
Pages = {5-20},
Publisher = {Springer-Verlag},
@houshuang
houshuang / insta.play.clj
Created April 22, 2013 13:54
Newbie Clojure question
(defn testa []
(let [a (atom {})]
(println a)
(let [b (atom {:hi 1})]
(println a b)
(swap! a conj b))))
(testa)
(defn testa []
(let [a {}]
(println a)
(let [b {:hi 1}]
(println a b)
(conj a b))))