Skip to content

Instantly share code, notes, and snippets.

Avatar

Jimmy Eisenhauer jimmyeisenhauer

View GitHub Profile
View Javascript String Replace Benchmarks
var Benchmark = require('benchmark');
var escapeRegex = require('escape-string-regexp');
var suite = new Benchmark.Suite;
var text = "Contrary to popular belief, Lorem Ipsum is not simply random text. mouse It has roots in a mouse piece of classical Latin \
literature from 45 BC, making it over 2000 mouse years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, \
looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum mouse passage, and going through the cites of the word in \
classical literature, fish discovered the mouse undoubtable source. Lorem mouse Ipsum comes from sections 1.10.32 and 1.10.33 of de Finibus \
@jimmyeisenhauer
jimmyeisenhauer / cycleOSXWifi
Created Mar 14, 2016
Shell script to cycle osx wifi connection in a loop
View cycleOSXWifi
#!/bin/bash
COUNTER=0
while [ $COUNTER -lt 10 ]; do
echo The counter is $COUNTER
let COUNTER=COUNTER+1·
networksetup -setairportpower airport off; networksetup -setairportpower airport on
sleep 5
done
@jimmyeisenhauer
jimmyeisenhauer / nightwatch_chai.js
Created Aug 12, 2015
Recreate nightwatch.js chai issue
View nightwatch_chai.js
var expect = require('chai').expect;
module.exports = {
before : function(browser) {
console.log('Setting up...');
},
View sample.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View selenium
def create_button
@driver.find_element(:link, 'Create')
end
def create_button_click
@wait = Selenium::WebDriver::Wait.new(timeout: 8)
puts 'DEBUG: Clicking Create Button'
create_button.click
puts 'DEBUG: Waiting for View This Challenge'
@wait.until { @driver.find_element(:link, 'view this challenge') }
@jimmyeisenhauer
jimmyeisenhauer / build.sh
Created Nov 30, 2012 — forked from jonah-williams/build.sh
Command line iOS project builds and over-the-air distribution
View build.sh
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@jimmyeisenhauer
jimmyeisenhauer / gist:2795771
Created May 27, 2012
Drop and Rebuild Heroku database
View gist:2795771
heroku pg:reset SHARED_DATABASE --confirm fasterfaster
heroku run rake db:migrate
heroku run console
Rails.cache.clear
heroku restart
- manually add one record to test
- run performance test
View test.rb
this is a test of gist command
@jimmyeisenhauer
jimmyeisenhauer / learninruby1
Created Aug 26, 2011
code sample for my blog article...and a test of github:gist fetaure
View learninruby1
rails new learninruby
cd learninruby
bundle install
rails server //It worked on the dev server!
git add .
git commit -m "first commit"
heroku create jameseisenhauer