Skip to content

Instantly share code, notes, and snippets.

View tmandry's full-sized avatar

Tyler Mandry tmandry

View GitHub Profile
@mikegehard
mikegehard / Setting longer HTTP timeout in capybara
Created April 15, 2011 19:20
Setting longer HTTP timeout in capybara
# We need this to fix the random timeout error that we were seeing in CI.
# May be related to: http://code.google.com/p/selenium/issues/detail?id=1439
Capybara.register_driver :selenium_with_long_timeout do |app|
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120
Capybara::Driver::Selenium.new(app, :browser => :firefox, :http_client => client)
end
Capybara.javascript_driver = :selenium_with_long_timeout
require "money"
class Decorator < BasicObject
undef_method :==
def initialize(component)
@component = component
end
def method_missing(name, *args, &block)
@maxim
maxim / spec_helper.rb
Created June 9, 2012 18:14
Making after_commit play nice with use_transactional_fixtures.
# This is an example of how to use database_cleaner gem and
# RSpec tags to make `after_commit` hook play nice with
# `use_transactional_fixtures`.
# Simply mark the specs that use after_commit with
# `:uses_after_commit` tag.
# ...
require 'database_cleaner'
@nilium
nilium / key-bindings.json
Created August 11, 2012 23:14
A Sublime Text 2 plugin to enable running multiple commands in any given context from a single key binding.
[
{
"keys": ["ctrl+w"],
"command": "run_multiple",
"args": {
"commands": [
{"command": "find_under_expand", "args": null, "context": "window"},
{"command": "show_panel", "args": {"panel": "find"}, "context": "window"}
]
}
@puffnfresh
puffnfresh / CGSSpaces.h
Last active February 20, 2023 17:57
Header for undocumented Spaces APIs
#include <Carbon/Carbon.h>
typedef void *CGSConnectionID;
extern CGSConnectionID _CGSDefaultConnection(void);
#define CGSDefaultConnection _CGSDefaultConnection()
typedef uint64_t CGSSpace;
typedef enum _CGSSpaceType {
kCGSSpaceUser,
kCGSSpaceFullscreen,

ruby-1.9.3-p484 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p484 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@tmandry
tmandry / configure.diff
Created April 22, 2013 04:31
Getting the octave-forge java package (v1.2.9) to install on OS X Lion. See below for instructions and more information.
--- /tmp/java/src/configure 2012-07-25 11:34:49.000000000 -0500
+++ configure 2013-04-21 22:56:40.000000000 -0500
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.65.
#
@@ -3252,9 +3252,10 @@
java_version=`$JAVA -version 2>&1 | sed -n -e 's/^java version[^0-9"]*"\([^"]*\)"/\1/p'`
@rjw57
rjw57 / CGSPrivate.h
Last active December 2, 2022 06:36
CGSPrivate.h - undocumented APIs for OSX. Re-licensed under MIT licence.
/* CGSPrivate.h -- Header file for undocumented CoreGraphics stuff. */
/* This file is a relicensed portion of DesktopManager and was originally released under
* the terms of the GNU General Public Licence. Original licence text follows the new terms.
* The contents of this file has been re-released by the original author under the following terms:
*
* Copyright (C) 2003, 2004, 2013 Richard J Wareham <richwareham@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software

ruby-1.9.3-p448 cumulative performance patch for rbenv

(I guarantee nothing. No warranty I am not responsible blah blah blah. Seems to work great for me so far. Thanks to Tyler Bird who I forked this from.)

This installs a patched ruby 1.9.3-p448 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

@avimar
avimar / gist:5968480
Created July 10, 2013 17:47
Install newrelic with salt-stack on your debian/ubuntu system
#install instructions at https://newrelic.com/docs/server/server-monitor-installation-ubuntu-and-debian
base:
pkgrepo.managed:
- humanname: Newrelic PPA
- name: deb http://apt.newrelic.com/debian/ newrelic non-free
# - dist: precise
- file: /etc/apt/sources.list.d/newrelic.list
- keyid: 548C16BF
- keyserver: subkeys.pgp.net