Skip to content

Instantly share code, notes, and snippets.

MAKEDEV.i686 3.24-6.6.amzn1 installed
PyYAML.i686 3.09-5.5.amzn1 installed
acl.i686 2.2.49-4.8.amzn1 installed
acpid.i686 1.0.10-2.1.6.amzn1 installed
alsa-lib.i686 1.0.21-3.8.amzn1 installed
apr.i686 1.3.9-3.8.amzn1 @amzn-main
apr-devel.i686 1.3.9-3.8.amzn1 @amzn-main
apr-util.i686 1.3.9-3.9.amzn1 @amzn-main
apr-util-ldap.i686 1.3.9-3.9.amzn1
@rhettc
rhettc / gitconfig
Created June 5, 2013 20:12
git color config
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
@rhettc
rhettc / ember-sample.js
Last active December 30, 2015 23:39
A look at controllers and templates
// Establishing routes
<script type="text/javascript">
Notes.Router.map(function () {
this.resource('notes', {path: "/"}, function() {
this.route('note', {path: "/note/:note_id"});
});
});
Notes.NotesRoute = Ember.Route.extend({
// Note here where we are "setting the subject for the index action"
@rhettc
rhettc / with-block.hbs
Created December 18, 2013 17:40
Yay - with blocks
When you're dealing with nested properties, a with block can define a context so that you don't have to write out the full dotted path.
The example below shows that inside the block we can directly access the properties of the book like title without typing book.title.
This is one of my favorite bits of syntactic sugar from VB.NET, glad to see it here.
{{#with book}}
<div class=”book”>
<h1>{{title}}</h1>
{{author}}<br />
{{text}}</p>
</div>
@rhettc
rhettc / .pryrc
Last active August 29, 2015 13:56
def app_path
unless @app_path
git_root = `git rev-parse --show-toplevel`.chomp
@app_path = $?.success? ? git_root : Dir.pwd
end
@app_path
end
class Exception
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@rhettc
rhettc / pgactivity
Created April 16, 2014 23:37
Show open connections to databases in a brief format conducive to CLI usage
SELECT procpid as pid,
usename as user,
datname as db,
application_name as app, waiting as wait, current_query as query
FROM pg_stat_activity
WHERE datname <> 'postgres';
const int c = 261;
const int d = 294;
const int e = 329;
const int f = 349;
const int g = 391;
const int gS = 415;
const int a = 440;
const int aS = 455;
const int b = 466;
const int cH = 523;
@rhettc
rhettc / big_consumers.sh
Created September 15, 2014 19:05
disk usage
du -chd1 -t1G
# include grand total, friendly sizes, max depth 1, greater than 1G
@rhettc
rhettc / Program.cs
Last active August 29, 2015 14:08 — forked from anonymous/Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TemplateFoo
{
class Program
{