Skip to content

Instantly share code, notes, and snippets.

View dmittakarin8's full-sized avatar

Denis Mittakarin dmittakarin8

  • Tucson AZ
View GitHub Profile
@myobie
myobie / Gemfile
Created June 21, 2011 12:30
unfurler.heroku.com
source :rubygems
gem 'sinatra'
gem 'httparty'
gem 'haml'
gem 'json'
group :development do
gem 'shotgun'
end
@sstephenson
sstephenson / gist:1120938
Created August 2, 2011 19:08
Quick guide to installing rbenv
# Clone rbenv into ~/.rbenv
git clone git@github.com:sstephenson/rbenv.git ~/.rbenv
# Add rbenv to your PATH
# NOTE: rbenv is *NOT* compatible with rvm, so you'll need to
# remove rvm from your profile if it's present. (This is because
# rvm overrides the `gem` command.)
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile
exec $SHELL
# Part 1
def palindrome?(string)
string = string.downcase.gsub(/\W/, '')
string == string.reverse
end
def count_words(string)
Hash[string.downcase.gsub(/[^\w\s]/,'').split(' ').group_by{|s| s}.map{|kv| [kv[0], kv[1].size]}]
end
@andrewdavidcostello
andrewdavidcostello / advanced_oop.rb
Created March 7, 2012 21:03
SaaS-Class: Homework 1
class Class
def attr_accessor_with_history(attr_name)
attr_name = attr_name.to_s # make sure it's a string
attr_reader attr_name # create the attribute's getter
attr_reader attr_name + "_history" #create history getter
class_eval %{
def #{attr_name}=(val)
@#{attr_name} = val
@#{attr_name}_history = [nil] if @#{attr_name}_history.nil?
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@nopslider
nopslider / gnmap.pl
Created July 12, 2013 13:05
Nmap gnmap parser for command line foo
#!/usr/bin/perl -nl
use strict;
next if ( $_!~m/Ports\:/i );
chomp();
my @toks=split( /Ports\:\s*/i, $_ );
my $host=$toks[0];
$host=~s/\s*Host\s*\:\s*(.*?)\s*\(.*?\).*/$1/ig;
@jmtame
jmtame / gist:6458832
Last active March 26, 2018 07:49
ruby blocks and yield explained by a bloc mentor

The following is an explanation of Ruby blocks and yield by another Bloc mentor (Adam Louis) who was trying to explain it to one of his students.

On my very first day programming, if someone asked me for "the sum of the numbers from 1 to 10", I'd have written:

puts 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10

Easy enough.

@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.