Skip to content

Instantly share code, notes, and snippets.

@fny
fny / virtualenv-burrito.sh
Created April 20, 2012 19:51
Custom Virtualenv Burrito Setup Script
#!/bin/bash
#
# virtualenv-burrito
#
# One command to have a working virtualenv + virtualenvwrapper environment.
#
set -e
VENVBURRITO="$HOME/.venvburrito"
VENVBURRITO_esc="\$HOME/.venvburrito"
@fny
fny / Gemfile
Created April 30, 2012 02:21 — forked from rafaelss/Gemfile
rack static site
source "http://rubygems.org"
gem 'rack-contrib', :git => 'git://github.com/rack/rack-contrib.git'
gem 'rack-rewrite'
@fny
fny / StartMenu_GridScene_320x240.cpr
Created May 11, 2012 08:22
Windows Mobile 6.5 Start Menu
<Form Width="320" Height="240">
<StartMenu_GridScene ID="Scene">
<GridView ID="Start Menu Items List" Top="0" Left="0" Width="320" Height="188" Columns="5" Scrollable="TRUE" HexagonGrid="TRUE" HorizontalWrapAround="TRUE" VerticalWrapAround="TRUE">
<Image ID="Selection" Left="0" Top="-15" Width="80" Height="79" Source=".\StartMenu_Selection.png" />
<Layer ID="GridItem" Width="80" Height="83" OnAction ="GridItemAction">
<Layer ID="Normal">
<Image ID="Image" Left="25" Top="8" Width="30" Height="30" ScaleStyle="Fit" />
<Text ID="Text" Left="9" Top="49" Width="64" Height="34" FontFamily="Tahoma" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Top" Wrap="True" Trimming="EllipsisCharacter" ForeColor="#00FFFFFF" BackColor="#00000000" />
@fny
fny / HelloWorldLoops.java
Created September 10, 2012 22:55
Loops and Variable Declaration Location Comparison with Java Bytecode
class HelloWorldLoops {
void stringDeclaredInsideLoop(){
while (true) {
String greeting = "Hello World!";
doNothing(greeting);
}
}
void stringDeclaredOutsideLoop(){
String greeting;
while (true) {
@fny
fny / calibre-installer.sh
Last active April 5, 2019 22:24
OS X Calibre Installer. Now an app: https://github.com/fny/calibre-Installer
#! /bin/sh
#
# Install the latest version of calibre for OS X
# Replaces any existing version in /Applications or ~/Applications
#
# Copyright (C) 2013 Faraz Yashar
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
@fny
fny / imagemagick_fix_for_rmagick.sh
Last active July 27, 2020 01:20
OS X shell script to fix RMagick compilation issues when using Homebrew's ImageMagick installation. This script will create the symlinks needed for RMagick to compile. Quantum depths of 8 and 16-bits supported.
#! /bin/sh
#
# An OS X shell script to fix RMagick compilation issues when using Homebrew's
# ImageMagick installation. This script creates the symlinks needed for
# RMagick to compile. Quantum depths of 8 and 16-bits are supported.
#
# You can run this script with "sh whatever_script_name.sh" in your terminal
# or with a click if you change the file extension to "command".
#
# You can manually make the links by visiting the ImagicMagick library
@fny
fny / GNU GPL.md
Created January 30, 2013 22:06
GNU General Public License in Markdown

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

@fny
fny / GNU GPL Comment Headers.md
Last active July 13, 2025 19:49
GNU GPL formatted into a comment block and hard wrapped at 80 characters.

GNU GPL Comment Headers Formatted in Various Languages

A convenient reference for adding a GPL license to a work.

All prepared texts are hard wrapped at 80 characters unless stated otherwise.

No Wrap

@fny
fny / heroku_push.sh
Created April 30, 2013 19:25
Quick n' dirty Heroku pushes.
#! /usr/bin/env bash
set -e
repo_dir=`pwd`
current_branch=`git rev-parse --abbrev-ref HEAD`
timestamp=`date +"%Y%m%d%H%M"`
push_dir="heroku-$timestamp"
echo "Copying the repository into $push_dir for pushing..."
cd ../
@fny
fny / Chrome Readrboard Block.md
Created November 11, 2013 01:25
Chrome extension to block Readrboard's engage.js for performance testing.

This Chrome extension blocks Readrboard's engage.js.

To install, clone this gist or save the files in a new directory. Then visit Chrome's extension dashboard (chrome://extensions/), enable developer mode, and install the unpacked extension.

You can modify the URLs by modifying the urls array in background.js. See Chrome's Match Patterns for valid URL patterns. Note you'll also need to add/update the respective URL in the permissions section of manifest.json to allow the extension to block the scripts from the specified addresses.

See the documentation for Chrome's webRequest.onBeforeRequest for more information.