Skip to content

Instantly share code, notes, and snippets.

View sintaxi's full-sized avatar
🔥
GSD

Brock Whitten sintaxi

🔥
GSD
View GitHub Profile
#!/bin/bash
curl -sSN http://ffmpeg.org/releases/ffmpeg-3.2.4.tar.bz2 | tar -xjf-
cd ffmpeg-3.2.4
(./configure --help|head -n255|grep -- '--enable-'\
| perl -pe's/.*(--enable-\S+).*/$1/g' | grep -v = # 255: toolchain options
./configure --list-encoders|perl -pe's/\s+/\n/g'|sed 's/^/--enable-encoder=/'
./configure --list-decoders|perl -pe's/\s+/\n/g'|sed 's/^/--enable-decoder=/'
./configure --list-hwaccels|perl -pe's/\s+/\n/g'|sed 's/^/--enable-hwaccel=/'
./configure --list-muxers|perl -pe's/\s+/\n/g'|sed 's/^/--enable-muxer=/'
./configure --list-demuxers|perl -pe's/\s+/\n/g'|sed 's/^/--enable-demuxer=/'
@sintaxi
sintaxi / 🐢.js
Last active November 14, 2016 21:51
🐢🐢🐢 All the way down.
var 🐢 = function(mstr){
if (!mstr) mstr = {}
return function(config){
for (var attr in config) { mstr[attr] = config[attr] }
var obj = scope(mstr)
obj.exec = function(){
// awesome things here
@sintaxi
sintaxi / thing.js
Last active July 9, 2016 22:00
A JavaScript question. What is the best way to handle this situation?
var expensiveThing = function(callback){
setTimeout(function(){
callback(null, { name: "Thurston Moore" })
}, 5000)
}
var fetchAndLogExpensiveThing = function(){
expensiveThing(function(err, data){
console.log(err, data)
Please review the following abuse complaint and provide us with a resolution:
******************************
CloudFlare received a trademark infringement complaint regarding:
sharethesafety.org
Please be aware CloudFlare is a network provider offering a reverse proxy, pass-through security service. We are not a hosting provider. CloudFlare does not control the content of our customers.
The actual IP address hosting sharethesafety.org is 192.241.214.148. Using the following command, you can confirm the site in question is hosted at that IP address: curl -v -H "Host: sharethesafety.org" 192.241.214.148/
@sintaxi
sintaxi / webhook.md
Created May 13, 2016 14:49
webhook for surge

Example of a webhook server:

var http = require('http')
var express    = require('express')
var bodyParser = require('body-parser')

var app = express()

// parses application/json
global
maxconn 4096
pidfile /Users/sintaxi/Documents/Node/Modules/pids/haproxy.pid
defaults
mode http
retries 3
option redispatch
option httpclose
maxconn 2000
var fs = require("fs")
var request = require("request")
var filePath = __dirname + "/payload.tar.gz"
fs.createReadStream(filePath).pipe(request.put('http://api.lvh.me:3001/').pipe(process.stdout))
@sintaxi
sintaxi / _layout.jade
Created January 10, 2014 04:50
How to do navigation with Harp. Put the following files in a directory and start the server with `harp server`. Compile to html by running `harp compile`.
doctype
html
head
link(rel="stylesheet" href="/main.css")
body
ul
li(class="#{ current.source == 'index' ? 'active' : '' }")
a(href="/") Home
li(class="#{ current.source == 'about' ? 'active' : '' }")
a(href="/about") About
@sintaxi
sintaxi / transition.js
Created December 19, 2013 01:36
Transition bliss
var Transition = function(callback){
this.instantOperations = []
this.deferredOperations = []
this.total = 0
this.count = 0
this.callback = callback || new Function()
return this;
}
Transition.prototype.add = function(el, args, cb){
@sintaxi
sintaxi / test.js
Created December 17, 2013 20:48
superagent not returning a body when status code is 500. running node v0.10.17.
var http = require('http')
var assert = require('assert')
var agent = require('superagent')
http.createServer(function (req, res) {
res.writeHead(500, {'Content-Type': 'text/plain'})
res.end('Hello World\n')
}).listen(1337, '127.0.0.1', function(){
agent.get('http://127.0.0.1:1337/').end(function(err, response){
assert.equal(response.status, 500)