Skip to content

Instantly share code, notes, and snippets.

@mudge
mudge / application_helper.rb
Created November 7, 2008 14:37
Widon't helpers for Rails (both the original and 2.1 versions).
module ApplicationHelper
# Shaun Inman's original Widon't
# http://shauninman.com/archive/2006/08/22/widont_wordpress_plugin
#
# @param [String] text the text to apply Widon't to
# @return [String] the text with Widon't applied
def widont(text)
text.strip!
text[text.rindex(' '), 1] = ' ' if text.rindex(' ')
@jgarber
jgarber / MIT-LICENSE.txt
Created April 4, 2012 14:57
Responsive video
Copyright (c) 2011 ZURB, http://www.zurb.com/
@inflammable
inflammable / base58.js
Created June 14, 2012 09:50
Base58 (and other) Encoding and Decoding in Javascript
/*
* base58.js
* - encodes integers to and decodes from a base58 (or your own) base58 alphabet
* - based on Flickr's url shortening
*
* usage:
* base58.encode(integer);
* base58.decode(string);
*
* (c) 2012 inflammable/raromachine
@stevie-chambers
stevie-chambers / SinatraAPI.rb
Created July 10, 2012 00:09
Real basic REST API server in one script
#!/usr/bin/env ruby
#
# [email protected] July 2012
#
# I'm playing around with APIs, and sharing my learnings
# You can follow my trials and tribulations at http://viewyonder.com/apis
#
# This is a simple Ruby script to show how a simple API might work.
# The resource model is just a simple array of a single class - no back-end store (yet)
#
@sway
sway / fontawesome.sty
Created July 12, 2012 23:14
FontAwesome mapping for XeLaTeX
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX
% Author: Honza Ustohal <[email protected]>
%
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter
% This might be reworked into a full blown package in the near future
%
% Prerequisite:
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX
%
% Usage:
@irasally
irasally / run.sh
Created October 3, 2012 05:07
[mongodb] run command 'compact' for all collections
#!/bin/sh
mongo localhost:27017/mongo run_command.js
mongo localhost:27018/mongo run_command.js
mongo localhost:27019/mongo run_command.js
# if you don't need connection infomation etc., use --quiet option.
# http://www.mongodb.org/display/DOCS/--quiet
@bramhaghosh
bramhaghosh / saucelabs_demo.rb
Created October 11, 2012 17:51
saucelabs demo
require 'pry'
require 'watir-webdriver'
include Selenium
def capabilities
opts = {:platform => :any, :javascript_enabled => true}
capabilities = WebDriver::Remote::Capabilities.ie(opts)
end
def set_up_grid_browser
@DanPatey
DanPatey / gist:4253541
Created December 10, 2012 21:23
List of iPhone and iPad sauce drivers
def local_driver
Selenium::WebDriver.for(@browser.to_sym)
end
def iphone4_driver
caps = Selenium::WebDriver::Remote::Capabilities.iphone
caps.platform = 'Mac 10.6'
caps.version = '4.3'
Selenium::WebDriver.for(
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 10, 2024 03:45
A badass list of frontend development resources I collected over time.
ProjectM notes:
Install JackOSX 0.90 beta 13 from:
http://www.jackosx.com
Install cmake using Homebrew
Download Qt from:
https://qt-project.org/downloads
I used Qt4 and compiled it statically from source. Static building isn't necessary but made it (in some ways) easier to make a self-contained application.
Download ProjectM source code from:
https://sourceforge.net/projects/projectm/files/2.1.0/projectM-complete-2.1.0-Source.tar.gz/download