Download version depending on operating system.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Stc::App.helpers do | |
class Readable | |
def self.date(utc) | |
utc.to_date.strftime("%B %-d, %Y") | |
end | |
def self.text_from_value(value) | |
_text = value.split('_') |
Slim::Engine.default_options[:pretty] = true |
.DS_Store | |
log/**/* | |
tmp/**/* | |
bin/* | |
vendor/gems/* | |
!vendor/gems/cache/ | |
.sass-cache/* | |
db/*.db | |
.*.sw* | |
.sass-cache |
gem 'slim', :git => 'git://github.com/brennancheung/slim.git', :branch => 'angularjs_support' |
AppName::App.helpers do | |
class FormatData | |
# From value to human format | |
def self.to_human(value) | |
if value =~ /_/ | |
words = value.split('_') | |
words.map!{ |word| word.capitalize } | |
return words.join(' ') |
<img src="https://bucketname.s3.amazonaws.com/path/filename.ext"> |
Download version depending on operating system.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
### If you get a really long list of IP addresses from a text file. Display the top 10 repeated IPs. | |
def top_10_ips(file) | |
# Select only the itmes that are repeated more than once | |
unique = [] | |
repeated = [] | |
File.open(file, 'r').each do |ip_line| |
### If you get an array of numbers, sum its numbers. | |
def sum_array_numbers(numbers) | |
numbers.inject(:+) | |
end | |
sum_array_numbers([10, 24, 11, 3, 14, 24]) |