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
require 'ostruct' | |
class Setting < ActiveRecord::Base | |
class SettingNotFound < RuntimeError ; end | |
validates_uniqueness_of :key | |
serialize :value | |
class << self |
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
# /bin/bash | |
// save as somefile.sh and apply execution permissions | |
// Installing jupiter for battery managment on ubuntu 11.10 64-bit, works for 32-bit computers too | |
sudo add-apt-repository ppa:webupd8team/jupiter | |
sudo apt-get update | |
sudo apt-get install jupiter |
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
function parse_git_dirty { | |
git diff --quiet HEAD &>/dev/null | |
[[ $? == 1 ]] && echo "…" | |
} | |
if [ -n __git_ps1 ]; then | |
function parse_git_branch { | |
local branch=$(__git_ps1 "%s") | |
[[ $branch ]] && echo " $branch$(parse_git_dirty)" | |
} | |
fi |
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
input[type="checkbox"] { | |
display: none; | |
& + label { | |
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; |
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 GenerateSDKFiles | |
FILE_NAMES = [ "application.js" ] | |
ONE_HOUR = 3600 | |
def generate | |
Rails.logger.info "Started to sync libraries #{FILE_NAMES}" | |
FILE_NAMES.each do |file_name| |
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
['Chicho', "Toño"].each do |name| | |
puts "Ola k ase #{name}" | |
end | |
system "node app.js" |
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
func makeIncrementer() -> (Int -> Int) { | |
func addOne(number: Int) -> Int { | |
return 1 + number | |
} | |
return addOne | |
} | |
var increment = makeIncrementer() | |
increment(7) |
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
recipients = ['email@example.com'] | |
mail_body = <<-HTML | |
Hello world! | |
HTML | |
mail = Mail.new do | |
delivery_method( | |
:smtp, | |
:address => "address", |
NewerOlder