Skip to content

Instantly share code, notes, and snippets.

View ELLIOTTCABLE's full-sized avatar
🐫

ELLIOTTCABLE

🐫
View GitHub Profile
@jcamenisch
jcamenisch / .profile fragment
Created January 24, 2012 19:19
Lightning-fast project-wide find/replace with git grep and sed
gg_replace() {
if [[ "$#" == "0" ]]; then
echo 'Usage:'
echo ' gg_replace term replacement file_mask'
echo
echo 'Example:'
echo ' gg_replace cappuchino cappuccino *.html'
echo
else
find=$1; shift
@rwaldron
rwaldron / process.js
Last active October 11, 2015 19:18
Are you really in node? Look for `process` and check its `[[Class]]`
// https://github.com/joyent/node/blob/master/src/node.cc
// Look for: process_template->SetClassName(String::NewSymbol("process"));
//
console.log(
typeof process !== "undefined" && {}.toString.call(process) === "[object process]"
);
@TooTallNate
TooTallNate / mp3player.js
Created October 24, 2012 17:42
node.js command line MP3 player in 9 lines of code!
var fs = require('fs');
var lame = require('lame');
var Speaker = require('speaker');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});
$VERBOSE = nil
require File.expand_path('../rooby', __FILE__)
Person = Rooby::Class.new 'Person' do
define :initialize do |name|
@name = name
end
define :name do
import os
import tempfile
import subprocess
import errno
def _popen(cmd, stdin=None, stdout=None, stderr=None, notty=False):
if notty:
try:
p1 = subprocess.Popen(cmd, stdin=stdin,
stdout=subprocess.PIPE,
@t0yv0
t0yv0 / subtyping.v
Last active February 28, 2021 01:47
Demonstrating TypeScript 0.8 type system to be unsound. The subtyping relationship is defined in a way that admits the following code that results in TypeError exception being thrown.
Require Import Utf8.
Inductive subtype (a b : Set) : Set :=
| ST : (a -> b) -> subtype a b.
Infix ":>" := subtype (at level 50).
Definition st {x y} f := ST x y f.
Definition unpack {a b : Set} (st : a :> b) :=
@ELLIOTTCABLE
ELLIOTTCABLE / POST.sh
Last active December 6, 2024 10:11 — forked from metajack/irc.json
#!/bin/bash
OTP=$1
owner=$2
repo=$3
user=CHANGEME
curl -H "X-GitHub-OTP: $OTP" -i -u $user -X POST https://api.github.com/repos/$owner/$repo/hooks --data @irc.json
@davispuh
davispuh / steam_console_params.txt
Last active May 9, 2025 03:55
Steam client parameters, consoles commands and variables
-480p - Run tenfoot in 480p rather than 1080p
-720p - Run tenfoot in 720p rather than 1080p
-accesscode -
-all_languages - show longest loc string from any language
-batterytestmode - rapidly cycle battery percentages for testing
-bigpicture - Start in Steam Big Picture mode
-blefw -
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
anonymous
anonymous / gist:6770635
Created September 30, 2013 21:34
Github jobs linted by Scripting language
curl https://jobs.github.com/positions.json | joblint
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 210k 100 210k 0 0 71334 0 0:00:03 0:00:03 --:--:-- 74053
Joblint
Culture Fails |██████ (6)
Realism Fails |████ (4)
Recruiter Fails |████ (4)
@hilbix
hilbix / exec style aliases
Last active March 10, 2019 01:21
`git exec` to exec command within GIT directory. `git top` to exec on submodule top level directory (somewhat).
git config --global alias.exec '!exec '
git config --global alias.top '!f() { GIT_TOP="${GIT_DIR%%/.git/modules/*}"; [ ".$GIT_TOP" != ".$GIT_DIR" ] && cd "$GIT_TOP"; exec "$@"; }; f'
# THIS IS PUBLIC DOMAIN.
#
# `git exec` executes something in the current GIT module's base directory. `git exec pwd` gives this base.
# Stolen from http://stackoverflow.com/questions/957928/is-there-a-way-to-get-the-git-root-directory-in-one-command/957978#comment9747528_957978
#
# `git top` is like `git exec`, but executes in the topmost GIT directory, even from within a GIT submodule.