Skip to content

Instantly share code, notes, and snippets.

View distransient's full-sized avatar
🍜
Mmm noodles tasty

Kel distransient

🍜
Mmm noodles tasty
View GitHub Profile
/*
<nav>
<ul id="top-level">
<ul id="dropdown">
</ul>
</ul>
<ul id="top-level-2">
</ul>
@distransient
distransient / killport
Created December 13, 2013 02:02
Bash script to kill process on specified port
#!/bin/bash
lsof -i :${1} | awk 'NR!=1 {print $2}' | xargs kill
@distransient
distransient / script.gt
Created December 13, 2013 08:03
>greentext scripting
lines that do not begin with ">" are not interpreted
by the computer.
The keyword "be" adds values to the global object
>be me
>be large, forever alone
>be at home
output: { me, large, forever alone, at home }
@distransient
distransient / app.js
Last active December 31, 2015 11:59
example of modeling webpages with javascript objects
var foobar = require('foobar')
, app = foobar()
// this is an example of an entire webpage modeled in this fashion.
// partials may be modeled in this way as well, and most of these
// values should get opinionated defaults
document = {
// automatically add these to the head, ease of use
var a = require('http')
, b = []
, c = {
host: 'api.randomuser.me'
, path: '/'
, port: 80
, method: 'GET'
}
, d = function (e) {
var f = ''
@distransient
distransient / command.sh
Created December 25, 2013 05:54
Convert audio and still image into video
ffmpeg -loop 1 -i input.jpg -i input.mp3 output.avi
package main
import "math"
type CartesianPoint struct {
x, y, z float32
}
// set Spherical location from Cartesian location
func (vector *CartesianPoint) ToSpherical () SphericalPoint {
func FastInvSqrt(x float32) float32 {
i := math.Float32frombits(0x5f3759df - math.Float32bits(x)>>1)
return i * (1.5 - (x * 0.5 * i * i))
}
func FastInvSqrt64(x float64) float64 {
i := math.Float64frombits(0x5fe6eb50c7b537a9 - math.Float64bits(x)>>1)
return i * (1.5 - (x * 0.5 * i * i))
}
/*!
* Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/@font-face{
font-family:'FontAwesome';
src:url('../fonts/fontawesome-webfont.eot?v=4.0.3');
src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');
font-weight:normal;
font-style:normal
}
[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]](([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(![]+[])[!+[]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]