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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem 'sinatra' | |
gem 'httparty' | |
gem 'haml' | |
gem 'json' | |
group :development do | |
gem 'shotgun' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
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.
OlderNewer