Imagine this case:
class Account < ActiveRecord::Base
def transfer(other, quantity)
tries = 0
begin
tries += 1
transaction do
self.quantity -= quantity
#!/bin/bash | |
function star-command { | |
if [ "$1" == "" ] || [ "$1" == "-h" ]; then | |
echo "star-command \"command to store on your favorites\"" | |
echo "star-command -l \"list your favorites\"" | |
elif [ "$1" == "-l" ]; then | |
cat ~/.star-commands | |
else | |
echo "$1" >> ~/.star-commands |
# Sourceables | |
SOURCEABLE_DIR=/home/erick/sourceable/ | |
DIRS=($(ls $SOURCEABLE_DIR)) | |
for dir in "${DIRS[@]}"; do | |
if [[ "$dir" != *.ignore ]] | |
then | |
source "$SOURCEABLE_DIR$dir" | |
fi | |
done |
(function() { | |
var existingAngular = window.angular; | |
require("angular"); | |
var angular = window.angular; | |
window.angular = existingAngular || {}; | |
module.exports = angular; | |
})(); |
var http = require("http"); | |
var fs = require("fs"); | |
var mime = require("mime-types"); | |
var server = http.createServer(function(req, res) { | |
var path = "." + req.url; | |
fs.stat(path, function(error, stats) { | |
if (error) { | |
res.writeHead(404); |
var es = require("event-stream"); | |
module.exports = function() { | |
return es.map(function(file, callback) { | |
file.contents = new Buffer("(function() {\n" + String(file.contents) + "\n})();"); | |
callback(null, file); | |
}); | |
}; |
Imagine this case:
class Account < ActiveRecord::Base
def transfer(other, quantity)
tries = 0
begin
tries += 1
transaction do
self.quantity -= quantity
class String | |
def encrypt(options = {}) | |
crypt :encrypt, options | |
end | |
def decrypt(options = {}) | |
crypt :decrypt, options | |
end | |
private |