Skip to content

Instantly share code, notes, and snippets.

View mscharley's full-sized avatar

Matthew Scharley mscharley

View GitHub Profile
@bkimble
bkimble / gist:1365005
Last active May 2, 2024 01:27
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
@jpoehls
jpoehls / mklink.psm1
Created June 7, 2012 19:40
Native PowerShell wrapper for MKLINK.
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 31, 2024 10:00
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@dennisschneider
dennisschneider / gist:5907959
Created July 2, 2013 09:33
VirtualBox migration workaround: v4.2.14 ( "Progress object failure: NS_ERROR_CALL_FAILED") just replace "BaseBoxName" with your box, tested with precise32 + precise64
cd ~/.vagrant.d/boxes/BaseBoxName/virtualbox
openssl sha1 *.vmdk *.ovf > box.mf
@CMCDragonkai
CMCDragonkai / job_control_zsh_bash.md
Last active July 3, 2024 14:41
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@jaredly
jaredly / App.re
Last active January 1, 2021 17:34
ReasonReact Context API Example
module StringContext =
Context.MakePair({
type t = string;
let defaultValue = "Awesome";
});
let component = ReasonReact.statelessComponent("Tree");
let make = _children => {