Skip to content

Instantly share code, notes, and snippets.

View economysizegeek's full-sized avatar

Dirk Elmendorf economysizegeek

View GitHub Profile
@economysizegeek
economysizegeek / delay_api.php
Created August 30, 2016 14:46
Make a php endpoint that simulates a slow API Call
<?php
//Copyright 2016 Dirk Elmendorf
//This simulates a slow request to a remote api
if (isset($_GET["seconds"]) && $_GET["seconds"] != "null") {
$seconds = $_GET["seconds"];
}
else {
@economysizegeek
economysizegeek / gist:4770182
Created February 12, 2013 14:22
Do you have a usb/bluetooth headphone/mic setup on ubuntu? Make this change and Ubuntu will auto switch the input for mic and out put to the headphones when you plug in the headphones
# From http://askubuntu.com/questions/141947/headset-input-setting-as-default
sudo su -c 'echo "# From http://askubuntu.com/questions/141947/headset-input-setting-as-default
load-module module-switch-on-connect" >> /etc/pulse/default.pa '
pulseaudio -k
@economysizegeek
economysizegeek / my.rackpace.dns.js
Created September 19, 2011 15:08
This is some javascript to modify DNS records on my.rackspace.com .
//You have to paste in each one individually since they reload the entire page on submit instead of doing ajax.
$("input[name=host]")[0].value = "REPLACE_WITH_DOMAIN"
$('select[name=record-type]').attr("selectedIndex",0) //A
$("input[name=target]")[0].value = "REPLACE_WITH_IP"
$("input[name=recordAdd]")[0].click();
$("input[name=host]")[0].value = "REPLACE_WITH_DOMAIN"
$('select[name=record-type]').attr("selectedIndex",2) //CNAME
$("input[name=target]")[0].value = "REPLACE_WITH_OTHER_DOMAIN"
@economysizegeek
economysizegeek / jasmine_config.rb
Created September 19, 2011 15:03 — forked from rsim/jasmine_config.rb
Adds CoffeeScript support for jasmine gem (rake jasmine task), uses barista gem to compile CoffeScript files to JavaScript before running Jasmine tests. Updated for Jasmine 1.1.0
# put this file in spec/javascripts/support directory
require 'barista'
require 'logger'
require File.join(Rails.root, 'config/initializers/barista_config')
Barista.configure do |c|
c.env = 'test'
c.logger = Logger.new(STDOUT)
c.logger.level = Logger::INFO