Skip to content

Instantly share code, notes, and snippets.

@lfender6445
lfender6445 / gist:9919357
Last active May 2, 2024 22:40
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@revolunet
revolunet / lzw_encoder.js
Created February 25, 2011 14:55
LZW javascript compress/decompress
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i<data.length; i++) {
currChar=data[i];
@scottsb
scottsb / casesafe.sh
Last active January 16, 2024 08:47 — forked from Hais/workspace.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
@tlberglund
tlberglund / git-loglive
Last active January 12, 2024 03:40
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
@simpsoka
simpsoka / Leadership-CI.md
Last active December 20, 2023 15:40
This is a list of questions to check our decision making.

Do I want to die on this hill?

  • Pass: This is morally good and if not handled has long term consequences
  • Fail: This if self serving

Am I including everyone?

  • Pass: My ego is not driving this conversation
  • Fail: The people in this conversation will only tell me I'm right and not push back
@kennethreitz
kennethreitz / flaskapp.py
Created June 9, 2012 15:38
My typical flask app base
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask_heroku import Heroku
from flask_sslify import SSLify
from raven.contrib.flask import Sentry
from flask.ext.celery import Celery
@andyscott
andyscott / zoom.sh
Created September 23, 2015 16:35
zoom script for OSX
#!/usr/bin/osascript
# usage: zoom <room-number> [room-password] [--name=NAME]
on split(theString, theDelimiter)
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to theDelimiter
set theArray to every text item of theString
set AppleScript's text item delimiters to oldDelimiters
return theArray
@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox
@valyagolev
valyagolev / __init__.py
Created April 29, 2011 02:46
Django settings awesomness
from .base import *
try:
from .local import *
except ImportError:
pass
@noodlebug
noodlebug / bbcradio.sh
Last active February 23, 2021 14:03 — forked from stengland/bbcradio.sh
Play BBC Radio with mpd or mplayer from the command line
#!/bin/bash
play() {
playlist="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_$1_mf_p"
echo $playlist
if mpc
then
echo "Using mpc"
mpc add $playlist
mpc play
else