Skip to content

Instantly share code, notes, and snippets.

View rchrd2's full-sized avatar

Richard Caceres rchrd2

View GitHub Profile
@aviddiviner
aviddiviner / run-service.sh
Created March 4, 2014 00:11
Quick bash wrapper around a service; allows for environment setup and sends trapped signals
#!/bin/bash
handler () {
kill -s SIGINT $PID
while kill -0 $PID &>/dev/null
do
wait $PID
done
}
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@dr-dimitru
dr-dimitru / simplest-nodejs-nginx-config.conf
Created October 28, 2013 00:49
Simplest way for Nginx as Node.js reverse proxy [CONFIG]
server {
listen 80;
server_name domain.com;
location / {
proxy_pass http://mystream;
proxy_set_header Host $http_host;
}
}
@nikic
nikic / bench.php
Last active November 2, 2023 22:49
Benchmark of call_user_func_array vs switch optimization vs argument unpacking syntax
<?php error_reporting(E_ALL);
function test() {}
$nIter = 1000000;
$argNums = [0, 1, 2, 3, 4, 5, 100];
$func = 'test';
foreach ($argNums as $argNum) {
@alextucker
alextucker / README.md
Last active March 12, 2021 13:21
Installing Dokku and Deploying a Django App
@clayton
clayton / ffmpeg-install.sh
Created August 9, 2013 18:55
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd">
<en-export export-date="20130730T205637Z" application="Evernote" version="Evernote Mac">
<note>
<title>Test Note for Export</title>
<content>
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hello, World.
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
cat > .git/hooks/pre-commit
#!/bin/sh
make test
@VertigoRay
VertigoRay / init.pp
Created July 17, 2013 20:39
Puppet - sethostname /etc/puppet/modules/common/sethostname/manifests/init.pp
class sethostname {
file { "/etc/hostname":
ensure => present,
owner => root,
group => root,
mode => 644,
content => "$::fqdn\n",
notify => Exec["set-hostname"],
}
exec { "set-hostname":
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no