Skip to content

Instantly share code, notes, and snippets.

View tibbon's full-sized avatar

David Fisher tibbon

View GitHub Profile
@tibbon
tibbon / README.md
Created October 26, 2013 18:38 — forked from nikcub/README.md
@tibbon
tibbon / sublimehints.md
Created October 31, 2013 18:36
Sublime Hints of the Day

David's Sublime Hints

Hint 1 - Set default indentation to 2 spaces

A tab size of 2 almost always looks better and can fit more on screen

  • Click on Sublime Text -> Preferences -> Settings - User
  • Alter the file to add "tab_size: 2" and save it

Mine looks like the following:

@tibbon
tibbon / gist:7585992
Created November 21, 2013 17:32
Resque fix
# Update Gemfile
gem "resque", "~> 2.0.0.pre.1", github: "KNEIP/resque"
bundle install
bundle update
resque work
@tibbon
tibbon / readme.md
Created November 26, 2013 19:16
Markdown for Readmes

This is a big headers

This is a smaller header

This is a list:

  • Item 1
  • Item 2
  • Item 3

Or like this:

@tibbon
tibbon / suggested_gems.rb
Last active August 29, 2015 13:55
Suggested Ruby Gems for Development in Rails
gem 'dotenv-rails'
group :development do
gem 'time_difference'
gem 'pry-rails'
gem 'better_errors'
gem 'binding_of_caller'
gem 'annotate'
gem 'bullet'
gem 'debugger'
@tibbon
tibbon / method_scope_exercises.rb
Created September 24, 2014 16:12
WDI Method and Scope Exercises
####
# Exercise 1
# What bug prevents the circle circumference from being calculated in the code section below?
# How can you prevent such a bug in the future?
####
def circumference(r)
return 2 * pi * r
end
@tibbon
tibbon / map_each_array.rb
Created September 24, 2014 18:02
Ruby Array Map and Each
# .each is pretty easily, and simply loops through the array.
colors = ["red", "green", "blue"]
colors.each do |color|
puts color
end
# What is the "return value" of each?
@tibbon
tibbon / ruby_bytecode_view.rb
Created November 11, 2014 20:22
Viewing Ruby Bytecode
code = <<SRC
puts "Hello World"
SRC
bytecode = RubyVM::InstructionSequence.compile(code)
puts bytecode.disasm
@tibbon
tibbon / bubble_sort.c
Created December 3, 2014 15:34
Bubble Sort in C
#include <stdio.h>
#define ARRAYSIZE 8
void bubble_srt(int unsortedArray[], int arraySize) {
int temp;
for(int i = 0; i < arraySize; i++) {
for(int j = 0; j < (arraySize - 1); j++) {