Skip to content

Instantly share code, notes, and snippets.

@pheuter
pheuter / sc-dl.js
Created March 5, 2012 20:44
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
@paolorossi
paolorossi / html5-video-streamer.js
Created March 7, 2012 13:21
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@mindsocket
mindsocket / lastmatchwithnums.py
Created March 19, 2012 02:41
Use beets' acoustid plugin, musicbrainz lookup and lastfm api to determine playcounts for a collection
#!/home/roger/.virtualenvs/lastfm/bin/python -u
"""
File: lastmatchwithnums.py
Author: Roger Barnes
A simple program for using acoustid to fingerprint and look up metadata (esp. play counts)
for MP3 files via lastfm. Usage:
$ python lastmatchwithnums.py [folder] ...
@marcboivin
marcboivin / ripdvd.sh
Created November 19, 2012 23:47
Rip Seasons DVD with handbrake
#!/bin/bash
# copyrights this guy http://ubuntuforums.org/showthread.php?t=1544346
# ripdvd.sh
# input must be:
# - <devicename> (which can be anything lsdvd takes)
# - <outputfolder> where do you want the ripped series
# - <outputname> the base name of the output
# - <startsfrom> where to start counting if you use 0 it starts at 1
# (useful for seasons spanning over multiple disks)
@caged
caged / svg-to-png.js
Created January 27, 2013 18:11
Convert SVG's to PNGs. This works OK if the SVG's styles are inline. The SVG element must contain an xmlns attribute. Webkit also requires you specify a font size on `text` elements.
var svg = document.getElementById('graph'),
xml = new XMLSerializer().serializeToString(svg),
data = "data:image/svg+xml;base64," + btoa(xml),
img = new Image()
img.setAttribute('src', data)
document.body.appendChild(img)
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active May 14, 2024 03:50
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@joyrexus
joyrexus / README.md
Last active May 3, 2024 11:41
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...

@drkameleon
drkameleon / gist:24f5207a8aa0177b284b
Created September 14, 2014 08:56
View-Based NSOutlineView Example
//
// AppDelegate.m
// sourceList
//
// Created by Dr.Kameleon on 9/14/14.
// Copyright (c) 2014 InSili.co. All rights reserved.
//
#import "AppDelegate.h"
@paulirish
paulirish / what-forces-layout.md
Last active June 26, 2024 20:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@bwhitman
bwhitman / picblast.sh
Created May 8, 2017 21:30
Make an audio collage out of your live photos
mkdir /tmp/picblast; cd ~/Pictures/Photos\ Library.photoslibrary; for i in `find . | grep jpegvideocompl`;do ffmpeg -i $i /tmp/picblast/${i:(-8)}.wav; done; cd /tmp/picblast; ffmpeg -safe 0 -f concat -i <( for f in *.wav; do echo "file '$(pwd)/$f'"; done ) ~/Desktop/picblast.wav; rm -rf /tmp/picblast