Skip to content

Instantly share code, notes, and snippets.

View myles's full-sized avatar
🦖

Myles Braithwaite myles

🦖
View GitHub Profile
@ingramchen
ingramchen / gist:e2af352bf8b40bb88890fba4f47eccd0
Created April 5, 2016 12:58
ffmpeg convert gif to mp4, for best cross browser compatibility
### Full command line options
```
ffmpeg -f gif -i FOO.gif -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' BAR.mp4
```
### Notie
* output mp4 is encoded with h264, support Firefox/Chrome/Safari in Windows, Mac OSX, Android, and iOS.
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@pydanny
pydanny / field.html
Created November 8, 2011 16:33
django-uni-form + Twitter Bootstrap
<!-- this usually goes in <project-root>/templates/uni_form/field.html -->
{% if field.is_hidden %}
{{ field }}
{% else %}
<div class="clearfix {% if field.errors %}error{% endif %}">
<label for="{{ field.auto_id }}" {% if field.field.required %}class="requiredField"{% endif %}>
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
<div class="input">
@wolever
wolever / wifi_and_power.rst
Created November 8, 2011 02:57
Wifi and power for medium sized tech events

This document is a practical checklist for anyone who needs to provide wifi and power for medium sized (10-100 attendants) tech events where attendees will expect to be able to plug in their laptops and get on a wireless network.

Full disclosure: I'm not an expert at this, but hopefully the things I've learned will be better than nothing.

General Notes

@psema4
psema4 / client.js
Created December 14, 2010 17:56
Simple Node.JS web server & client
// Modified from Node.JS documentation: http://nodejs.org/docs/v0.2.5/api.html#http-client-183
var http = require('http');
var server = http.createClient(8124, '127.0.0.1');
var request = server.request('GET', '/', {'host': '127.0.0.1'});
request.end();
request.on('response', function (response) {
console.log('STATUS: ' + response.statusCode);
console.log('HEADERS: ' + JSON.stringify(response.headers));
response.setEncoding('utf8');
-module(ring).
-export([start/3]).
-export([loop/1, loop/2]).
start(N, M, Message) when N > 1 -> spawn(fun() -> ring(N-1, M, Message) end).
ring(N, M, Message) when M > 0 ->
P = lists:foldl(fun(_, Proc) -> spawn(fun() -> loop(Proc) end) end, self(), lists:seq(1, N)),
@jchris
jchris / couchapp.html
Created November 27, 2010 15:14
the smallest possible CouchApp
<!DOCTYPE html>
<html>
<!-- This should be the simplest possible jQuery based CouchApp. Install by uploading to a design document in Futon or putting in _attachments/index.html and running `couchapp push` -->
<head><title>Tiny CouchApp</title></head>
<body>
<h1>Tiny CouchApp</h1>
<ul id="databases"></ul>
</body>
<script src="/_utils/script/jquery.js"></script>
<script src="/_utils/script/jquery.couch.js"></script>
@sifu
sifu / USAGE.txt
Created November 3, 2010 14:27
jsoneval
eg. to print the ids of all documents within a couchdb database:
curl "http://127.0.0.1:5984/somedb/_all_docs" | jsoneval.js "body.rows.forEach( function( r ){ console.info( r.id ) } );"