Skip to content

Instantly share code, notes, and snippets.

@illucent
illucent / Full Stack JavaScript.md
Created February 14, 2017 19:28 — forked from royshouvik/Full Stack JavaScript.md
Learn Full Stack JavaScript Web Development for FREE using resources like YouTube, Udacity and NodeSchool
@illucent
illucent / noise.sh
Created January 28, 2017 16:10 — forked from xguse/noise.sh
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-04
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)
@illucent
illucent / reltime.py
Created January 27, 2017 11:05 — forked from deontologician/reltime.py
Relative datetimes in python
def reltime(date, compare_to=None, at='@'):
r'''Takes a datetime and returns a relative representation of the
time.
:param date: The date to render relatively
:param compare_to: what to compare the date to. Defaults to datetime.now()
:param at: date/time separator. defaults to "@". "at" is also reasonable.
>>> from datetime import datetime, timedelta
>>> today = datetime(2050, 9, 2, 15, 00)
>>> earlier = datetime(2050, 9, 2, 12)
@illucent
illucent / vimeo.com.ffpreset
Created January 26, 2017 13:57 — forked from johnjohndoe/vimeo.com.ffpreset
FFmpeg settings for vimeo.com
// FFmpeg settings for vimeo.com
// =============================
// Trying to find the best settings for encoding videos as described here: http://vimeo.com/help/compression
//
// Input file: MTS
// Video: H264, 1920x1080, 50fps
// Audio: A52 Audio (aka AC3), Stereo, 48kHz, 256kbps
ffmpeg -i input.mts -vcodec libx264 -acodec aac -strict experimental -vpre hq -s hd720 -b 5000k -ab 320k -r 25 -g 25 -threads 0 output.mp4
@illucent
illucent / boilerplate.html
Created January 23, 2017 16:21 — forked from haydenbleasel/boilerplate.html
A powerful HTML5 boilerplate for the modern web.
<!-- HTML5 Doctype. Remember to delete these comments (Quirks Mode). -->
<!doctype html>
<!-- HTML tag -->
<html lang="">
<!-- Let's get started -->
<head>
<!-- Document settings and metadata -->
brew install Qt4
brew install openssl
brew install cmake
git clone https://github.com/PySide/pyside-setup.git --recurse-submodules
cd pyside-setup
# The following must be executed in a bash shell
python setup.py bdist_wheel --ignore-git --qmake=/usr/local/Cellar/qt/4.8.7_2/bin/qmake --openssl=/usr/local/Cellar/openssl/1.0.2h_1/bin/openssl --cmake=/usr/local/Cellar/cmake/3.5.2/bin/cmake
@illucent
illucent / parallel_curl.sh
Created December 20, 2016 19:43 — forked from CMCDragonkai/parallel_curl.sh
Bash: GNU Parallel with Curl
# do it once
seq 1 | parallel -n0 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'"
# do it twice
seq 2 | parallel -n0 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'"
# do it 4 times, but at 2 a time
seq 4 | parallel -n0 -j2 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'"
# you can also put all your commands into a file
@illucent
illucent / .zshrc
Created December 17, 2016 11:47 — forked from SlexAxton/.zshrc
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@illucent
illucent / nginx-ssl-configuration.conf
Created December 16, 2016 20:18 — forked from chmouel/nginx-ssl-configuration.conf
nginx-ssl-proxy-pass-configuration
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name blog.chmouel.com;
ssl on;
ssl_certificate /etc/letsencrypt/live/blog.chmouel.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/blog.chmouel.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@illucent
illucent / gist:beaf4a8c6a68bd4f5670f1c6f0c8d67e
Created December 15, 2016 11:20 — forked from Spoygg/gist:3122226
Keyboard switches for XKB setxkbmap
altwin:menu = +altwin(menu)
altwin:meta_alt = +altwin(meta_alt)
altwin:ctrl_win = +altwin(ctrl_win)
altwin:meta_win = +altwin(meta_win)
altwin:left_meta_win = +altwin(left_meta_win)
altwin:super_win = +altwin(super_win)
altwin:hyper_win = +altwin(hyper_win)
altwin:alt_super_win = +altwin(alt_super_win)
altwin:swap_lalt_lwin = +altwin(swap_lalt_lwin)
grp:switch = +group(switch)