This file contains hidden or 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
<script> | |
var images = [ | |
"http://philipdahl.com/crow/web1.jpg" | |
,"http://philipdahl.com/crow/web2.jpg" | |
,"http://philipdahl.com/crow/web3.jpg" | |
,"http://philipdahl.com/crow/web4.jpg" | |
,"http://philipdahl.com/crow/web5.jpg" | |
,"http://philipdahl.com/crow/web6.jpg" | |
,"http://philipdahl.com/crow/web7.jpg" |
This file contains hidden or 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
package main | |
import ( | |
r "github.com/dancannon/gorethink" | |
//$ "github.com/gorilla/mux" | |
"github.com/bmizerany/pat" | |
"log" | |
"net/http" | |
"time" | |
) |
This file contains hidden or 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
FROM ubuntu:trusty | |
### Notes: | |
## 1) don't use homebrew for go/docker on OSx, it's outdated and will cause headaches for any other install path | |
## 2) build with | |
## > docker build -t <repos_name> . | |
## 3) run with | |
## > docker run -d -P <repos_name> | |
## 4) view logs with | |
## > docker logs -f <container_nick> |
This file contains hidden or 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
#!/bin/bash | |
# A simple script to create an album artwork montage | |
## move files to within montage directory w/ prepended unix timestamp | |
c_time=$(date +%s) | |
for f in `ls /tmp | grep "now_playing-"` | |
do | |
mv /tmp/${f} /tmp/montage/${c_time}_${f} | |
c_time=$(($c_time + 1)) | |
done |
This file contains hidden or 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
App = Ember.Application.create() | |
App.Adapter = DS.RESTAdapter.extend() | |
App.store = DS.Store.create({ | |
revision: 11, | |
adapter: App.Adapter.create() | |
}) | |
App.MyModel = DS.Model.extend({ | |
name: DS.attr('string') |
This file contains hidden or 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
# http://blog.jazzychad.net/2012/08/01/array-iteration-problem.html | |
def argh(arr, val, n) | |
# change to arr2 = arr if you want to change the array in place | |
arr2 = arr.dup | |
tmp_range = (0..arr2.length) | |
tmp_range = n < 0 ? (n..arr2.length) : (0..(n-1)) unless n == 0 | |
tmp = [] | |
arr2.each_with_index { |v, i| tmp << [v, i] if v == val } | |
tmp[tmp_range].map! { |v| v[0] += val } | |
tmp.each { |v| arr2[v[1]] = v[0] } |