Skip to content

Instantly share code, notes, and snippets.

View lazypower's full-sized avatar
💭
Bring back independent blogs, rss feeds, and the small web.

Charles "Chuck" Butler lazypower

💭
Bring back independent blogs, rss feeds, and the small web.
View GitHub Profile
(android)
(areyoukiddingme)
(arrington)
(awyeah)
(basket)
(beer)
(bunny)
(bumble)
(cadbury)
(cake)
for (i = 1; i < 100; i++)
{
if( i % 5 === 0 && i % 3 === 0) {
console.log("fizbuzz");
}
else if (i % 3 == 0) {
console.log("buzz");
} else if (i%5 == 0) {
console.log("fiz");
}
@lazypower
lazypower / vim_cheatsheet.md
Created June 17, 2012 06:49
Vim Cheatsheet

###Working with multiple files

:e filename - Edit a file in a new buffer

:bnext (or :bn) - go to next buffer

:bprev (of :bp) - go to previous buffer

:bd - delete a buffer (close a file)

@lazypower
lazypower / traverse_and_merge.rb
Created August 9, 2012 00:43
Script to facilitate in exporting LightHouse tickets to CSV format for import elsewhere
require 'csv'
#Get a collection of all the directories contained in the CWD
directories = Dir.entries(Dir.pwd)
#iterate
directories.each do |dir|
#if its a directory, then traverse into it
if File.directory?(dir) then
@lazypower
lazypower / dropbox.sh
Created August 20, 2012 03:02
dropbox cli service
# dropbox service
DROPBOX_USERS="charles"
DAEMON=.dropbox-dist/dropbox
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
if [ -x $HOMEDIR/$DAEMON ]; then
@lazypower
lazypower / youtrack_comment_icons.user.js
Created August 22, 2012 14:18 — forked from dustyburwell/youtrack_comment_icons.user.js
YouTrack comment icons user script
// Copyright (c) 2012, Dusty Burwell
//
// ==UserScript==
// @name Emoticons for YouTrack
// @namespace http://dustyburwell.github.com
// @description Converts text to emoticons in YouTrack.
// @include http://youtrack/*
// @include https://youtrack/*
// ==/UserScript==
@lazypower
lazypower / git-l.sh
Created August 27, 2012 00:29
git l - ala gary bernhardt
HASH="%C(yellow)%h%Creset"
RELATIVE_TIME="%Cgreen(%ar)%Creset"
AUTHOR="%C(bold blue)<%an>%Creset"
REFS="%C(red)%d%Creset"
SUBJECT="%s"
FORMAT="$HASH}$RELATIVE_TIME}$AUTHOR}$REFS $SUBJECT"
show_git_head() {
pretty_git_log -1
@lazypower
lazypower / vomit.cs
Created August 29, 2012 03:45
vomit
public static object OccupationResultsFromAOI(string AreaOfInterest)
{
using (var db = new sandboxEntities())
{
var output = (from careermaps in db.CareerMaps
where
(from occupathbridges in db.OccuPathBridges
where
@lazypower
lazypower / sleeper.rb
Created September 5, 2012 00:42
Davinci Sleeper ruby script
wait_time = ARGV.shift
puts "waiting #{wait_time}"
`sleep #{wait_time}`
`notify-send --urgency=critical -i "Get Davinci out" "Time to get davinci out"`
@lazypower
lazypower / install_ruby.sh
Created September 12, 2012 04:04
RVM Ruby Install - Default Command Pipe
#!/bin/sh
#update sources first, always
sudo apt-get update
#fetch all dependencies
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
#fetch RVM and install
curl -L https://get.rvm.io | bash -s stable --ruby