Skip to content

Instantly share code, notes, and snippets.

@cerisier
cerisier / Dockerfile
Last active August 29, 2015 14:17
Drupal docker using drush make
FROM samos123/drupal:7.35
ADD drupal.make /drupal.make
RUN drush make --no-core /drupal.make /var/www/html
RUN ls -la /var/www/html/sites/all/modules ## this will show an empty directory instead of all my modules
ADD ./modules/anjuna_helper /var/www/html/sites/all/modules/anjuna_helper
#!/bin/bash
cd ~/Desktop
spinner()
{
local pid=$1
local delay=0.75
local spinstr='|/-\'
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
@cerisier
cerisier / chapters.md
Last active December 20, 2022 20:52
List iTunes podcast chapters to csv output
# ffprobe -v error -select_streams a:0 -show_chapters -of csv=print_section=1 ABGT160_847378.m4a

Example output:

chapter,0,1/600,0,0.000000,18523,30.871667,Group Therapy Intro - ABGT160
chapter,1,1/600,18523,30.871667,146505,244.175000,1. Arty ‘Kate’ [2015 Remix] (Anjunabeats)
chapter,2,1/600,146505,244.175000,262290,437.150000,2. Flashtech ’Shattered Dreams’ (Silk)
chapter,3,1/600,262290,437.150000,444517,740.861667,3. Bruce Gibson ‘Kristine’ [Adrian Alexander Remix] (Elliptical Sun)
@cerisier
cerisier / split.py
Created December 10, 2015 14:50
Split iTunes (m4a) chapters into tracks
import csv
import sys
# Reads input generated from ffprobe. Example below.
# ffprobe -v error -select_streams a:0 -show_entries stream=nb_read_frames ABGT160_847378.m4a
reader = csv.reader(sys.stdin, delimiter=',')
audio_file = sys.argv[1]
for row in reader:
g6Rib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgHFs/SeqaQ/FiQRHH1J2S72gtZL1RurBuQvdor18KwcMKp3BheWxvYWTFAut7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTAxZjI0NmY1MGJmYzRiOWMwODQ1NTVkYjA1NGJhNmRhMTQ1YzhjOWY3NmNhNDEyMDQ4ZjM1NzI2ODNjY2E4MGY1NDBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwMWM1YjNmNDllYTlhNDNmMTYyNDExMWM3ZDQ5ZDkyZWY2ODJkNjRiZDUxYmFiMDZlNDJmNzY4YWY1ZjBhYzFjMzBhIiwidWlkIjoiOTRmMzY3MmFkZDE0NDJhOTI5MTljZDk5YjgxZmQxMTkiLCJ1c2VybmFtZSI6ImNlcmlzaWVyIn0sInNlcnZpY2UiOnsibmFtZSI6ImdpdGh1YiIsInVzZXJuYW1lIjoiY2VyaXNpZXIifSwidHlwZSI6IndlYl9zZXJ2aWNlX2JpbmRpbmciLCJ2ZXJzaW9uIjoxfSwiY2xpZW50Ijp7Im5hbWUiOiJrZXliYXNlLmlvIGdvIGNsaWVudCIsInZlcnNpb24iOiIxLjAuNSJ9LCJjdGltZSI6MTQ1MjQ2NjMwNiwiZXhwaXJlX2luIjo1MDQ1NzYwMDAsIm1lcmtsZV9yb290Ijp7ImN0aW1lIjoxNDUyNDY2MzAwLCJoYXNoIjoiYzc2NGI5ZTA2MGQ0Y2M3YWQwZThhOTBlN2M5ZWVhYjIzZTViM2FhNDY5ZDgxOGVhMWNmOTk0NWYwNWZjYzZiZDRiNDNmZDhjZjJmZThiZTc2YjNmNzMzYmM4NzEzNWJmYjRhZDg2OGZiZGNhNDJkMWQzZWU2NmVkNzYyMDE5OTEiLCJzZXFubyI6MzQ2NjUzfSwicHJldiI6ImM1ZWIzOGI3MDZlMGRkM2RmNWRmNzAzMjFhNzVhNjliNDEz
@cerisier
cerisier / cue.bash
Created January 22, 2016 11:44
WIP of ffmpeg metadata to cue
AUDIO="file.m4a"
INPUT=$(ffprobe -v error -select_streams a:0 -show_chapters -of csv=print_section=1 AUDIO);
paste <(echo "$INPUT" | cut -d ',' -f 5 | cut -d '.' -f 1 | while read line; do date -d @$line; done) <(echo "$INPUT" | cut -d ',' -f 8)
💄⇒👉👌🔞⇒ 💦💦💧💧💧💦💦💧💧🌊 ⇒ 👅⇒😴
@cerisier
cerisier / random.txt
Created January 24, 2016 23:31
List of words for random entry creative technique
Adult
Aeroplane
Air
Aircraft Carrier
Airforce
Airport
Album
Alphabet
Apple
Arm
@cerisier
cerisier / Preferences.sublime-settings
Created February 5, 2016 13:56
Sublime : User preferences
{
"always_show_minimap_viewport": true,
"auto_complete_commit_on_tab": true,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
"auto_complete_triggers":
[
{
"characters": "ng-controller=\"*",
"selector": "punctuation.definition.string"
}
package main
import "fmt"
type Game struct {
Board [][]int
}
func (g *Game) semiDiagonalScore(rowDirection int, colDirection int, row int, col int) int {
fmt.Printf("checking direcetion %d,%d\n", rowDirection, colDirection)