Skip to content

Instantly share code, notes, and snippets.

View rgreenjr's full-sized avatar

Ron Green rgreenjr

View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
framework 'Foundation'
class NSIndexSet
def each
i = firstIndex
while i != NSNotFound
yield i
i = indexGreaterThanIndex(i)
end
end
@rgreenjr
rgreenjr / Git Cheat Sheet.md
Last active December 3, 2024 11:48
Git Cheat Sheet

Git Cheat Sheet

Common Commands

# stage all modified files being tracked
git add -u
@seanlilmateus
seanlilmateus / filesystem_events.rb
Created October 10, 2011 18:53
Handling Filesystem Events with GCD and Macruby
#!/usr/local/bin/macruby
framework 'Foundation'
include Dispatch
#``O_EVTONLY`` is defined as ``0x8000`` in the OS X header files.
# instead of RDONLY flag I use the O_EVTONLY flag to open() the file, otherwise we'll prevent the
# volume that the file is on from being unmounted.
O_EVTONLY = 0x8000
@dominic
dominic / gist:1873044
Created February 21, 2012 02:14
MacRuby App Store manual deployment steps

Submitting to the App Store

First, install Developer certs from Apple's Developer portal

To Build the Application:

  • Select "Your App" from your Scheme menu, NOT "Deployment"
  • Select Product > Archive to build for Release
  • Once completed, the Organizer window will open
  • Select your recent build and press the "Validate" button - make sure this passes!
@chadbrewbaker
chadbrewbaker / median.rb
Last active September 29, 2018 17:01
Implementation of the linear time median of medians algorithm.
# Gist to go with http://www.austinrochford.com/posts/2013-10-28-median-of-medians.html
# Chad Brewbaker 10/28/2013
# https://news.ycombinator.com/item?id=6628474
def median_5(list, i = list.length/2)
return list.sort[i]
end
def median(list, i = list.length/2)
if (list.length <= 5)
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@deepakkumarnd
deepakkumarnd / server_setup.sh
Last active October 8, 2024 00:49
Server setup script
# This script has to be run as a root user
echo "* Updating system"
apt-get update
apt-get -y upgrade
echo "* Installing packages"
apt-get -y install build-essential libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core nginx redis-server curl nodejs htop
id -u deploy &> /dev/null
if [ $? -ne 0 ]
@steven2358
steven2358 / ffmpeg.md
Last active December 25, 2024 19:28
FFmpeg cheat sheet
@zeyademam
zeyademam / Troubleshoot-dcnn.md
Last active January 22, 2024 05:54
Troubleshooting Convolutional Neural Nets

Troubleshooting Convolutional Neural Networks

Intro

This is a list of hacks gathered primarily from prior experiences as well as online sources (most notably Stanford's CS231n course notes) on how to troubleshoot the performance of a convolutional neural network . We will focus mainly on supervised learning using deep neural networks. While this guide assumes the user is coding in Python3.6 using tensorflow (TF), it can still be helpful as a language agnostic guide.

Suppose we are given a convolutional neural network to train and evaluate and assume the evaluation results are worse than expected. The following are steps to troubleshoot and potentially improve performance. The first section corresponds to must-do's and generally good practices before you start troubleshooting. Every subsequent section header corresponds to a problem and the section is devoted to solving it. The sections are ordered to reflect "more common" issues first and under each header the "most-eas