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
#EXTM3U | |
#EXT-X-VERSION:4 | |
## Created with Unified Streaming Platform(version=1.9.5) | |
# AUDIO groups | |
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-50",NAME="English",LANGUAGE="en",AUTOSELECT=YES,DEFAULT=YES,CHANNELS="1" | |
# variants | |
#EXT-X-STREAM-INF:BANDWIDTH=297000,CODECS="mp4a.40.2,avc1.4D001F",RESOLUTION=640x480,FRAME-RATE=25,AUDIO="audio-aacl-50",CLOSED-CAPTIONS=NONE | |
asset-audio=50000-video=230000.m3u8?grs=g147&dcp_ver=aos4&audiostream=1555_280.f4v:50000&videostream=1555_280.f4v:230000,1555_450.f4v:400000,1555_825.f4v:775000&AliasPass=c129-atr-vod-sms.secure.footprint.net |
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
# usuage ruby download_google_drive.rb <FILE ID> | |
fileid = ARGV[0] | |
confirm_code = `wget --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=#{fileid}' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\\1\/p'` | |
`wget --load-cookies cookies.txt 'https://docs.google.com/uc?export=download&confirm=#{confirm_code}&id=#{fileid}'` |
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( | |
"strings" | |
"github.com/DavidHuie/quartz/go/quartz" | |
) | |
var scores = map[string]int{ | |
"A": 1, "B": 3, "C": 3, "D": 2, | |
"E": 1, "F": 4, "G": 2, "H": 4, |
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
class Robot | |
DIRECTIONS = { | |
1 => "NORTH", | |
2 => "EAST", | |
3 => "SOUTH", | |
4 => "WEST" | |
} | |
attr_accessor :grid_size, :x, :y, :facing |
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
sql := "SELECT * FROM foo WHERE foo.name = $1" | |
args = append(args, "fred") | |
someArg := r.URL.Query().Get("some_arg") | |
someArg2 := r.URL.Query().Get("some_arg_2") | |
if someArg != "" { | |
args = append(args, someArg) | |
sql += " AND foo.some_arg = $" + strconv.Itoa(len(args)) | |
} |
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
I have a site (it's a rails app) that pulls some data from a variety of sources. It's pretty slow to generate and the customer wanted to deploy it in a windows environment so...The rails app is exported as a static site (it doesn't change very often) using wget -m (mirror). | |
- It needs to work in IE8 and the excanvas doesn't seem to support fillText (?) | |
- They have also some users that download the data images directly (e.g somesite.com/race/1/thingincanvas.jpg) for use on other systems | |
I figured the easiest way to solve all the problems was to generate the images from canvas and embed those instead of the canvas. As i'd have the image files, i could then easily support the second requirement. | |
The whole thing is a bit bonkers but customers. |
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 the root of your repository remove everything from the index | |
git rm --cached -r . | |
# Change the autocrlf setting of the repository (you may want | |
# to use true on windows): | |
git config core.autocrlf true | |
# Re-add all the deleted files to the index | |
# (You should get lots of messages like: | |
# warning: CRLF will be replaced by LF in <file>.) |
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
foos = Foo.where(params) | |
if foos.any? | |
# Foo Load (0.1ms) select count from foos where params | |
if foos.size == 1 && foos.first.attribute == 'bar' | |
# Foo Load (0.1ms) select count from foos where params | |
# Foo Load (0.1ms) select * from foos where params | |
end | |
end |
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
; -*- mode: clojure; -*- | |
; vim: filetype=clojure | |
(logging/init :file "/var/log/riemann/riemann.log") | |
; Listen on the local interface over TCP (5555), UDP (5555), and websockets | |
; (5556) | |
(let [host "127.0.0.1"] | |
(tcp-server :host host) | |
(udp-server :host host) |
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
//pin numbers | |
int LEFTRIGHT_DIR = 10; | |
int LEFTRIGHT_PWM = 9; | |
void setup() { | |
pinMode(LEFTRIGHT_DIR, OUTPUT); | |
pinMode(LEFTRIGHT_PWM, OUTPUT); | |
Serial.begin(9600); |
NewerOlder