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
<html> | |
<head> | |
<title>Need Wisdom?</title> | |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-1.1.0.min.css"> | |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/docs.css"> | |
<style> | |
.sidebar { background: #eee;} | |
.filler {background: #ff3; height: 20px; border: thin solid #999;} | |
</style> | |
</head> |
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
(1..10).each do |y| | |
(1..10).each do |x| | |
print (y * x).to_s.rjust(4) | |
print " | " | |
end | |
puts | |
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
require 'date' | |
puts Time.now.respond_to?(:strftime_nolocale) | |
class Time | |
Date::ABBR_DAYNAMES = %w(dom seg ter qua qui sex sab) | |
alias :strftime_nolocale :strftime | |
def strftime(format) | |
format = format.dup |
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
# encoding : utf-8 | |
# | |
# Author: Gabriel Engel | |
# Based on: https://github.com/rackspace/cloudfiles | |
# | |
require 'rubygems' | |
require 'cloudfiles' | |
# Configure Here |
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 rake | |
clone = { | |
db_host: "user@server", | |
rdbms: "postgresql", # postgresql or mysql | |
prod_db: "db", | |
prod_user: "user", | |
prod_pass: "pass", | |
dev_db: "localdb", | |
dev_user: "user", |
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 bash | |
# Setup a ubuntu 12.04 LTS machine with nginx, unicorn, ruby 1.9.3 | |
# RUN: curl -L http://goo.gl/M8SXl | bash | |
mkdir ~/server ; cd ~/server | |
wget https://github.com/gabrielengel/chef-ubuntu/tarball/master | |
tar -zxf master | |
cd gab* | |
mv dna.aws-sample.json dna.json |
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
def symbol_array_from_string(value) | |
regex = /\[((:([^ ,\]])+) *,{0,1} *)+\]/ | |
return value unless value =~ regex | |
value.scan(/:[^ ,\]]+/).map{|v| v.gsub(/^:/,'').to_sym} | |
end | |
result = symbol_array_from_string("[:a, :apple,:dog]") | |
result == [:a, :apple, :dog] |
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
/* | |
wysihtml5 v0.4.0pre + autoresize On Chrome | |
https://github.com/xing/wysihtml5 | |
Author: Christopher Blum (https://github.com/tiff) | |
Copyright (C) 2012 XING AG | |
Licensed under the MIT license (MIT) | |
Rangy, a cross-browser JavaScript range and selection library |
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
/** | |
* @license wysihtml5 v0.4.0pre | |
* https://github.com/xing/wysihtml5 | |
* | |
* Author: Christopher Blum (https://github.com/tiff) | |
* | |
* Copyright (C) 2012 XING AG | |
* Licensed under the MIT license (MIT) | |
* | |
*/ |
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
// Editor specific listener | |
editor.on("aftercommand:composer", resize); // Set bold, italic, etc | |
editor.on("change_view", resize); // Change wysi/source view | |
// Typing listeners | |
editor.on("newword:composer", resize); // Only way to observe on firefox | |
editor.on("undo:composer", resize); | |
editor.on("paste", resize); | |
iframeBody.addEventListener('keyup', resize, false); | |
iframeBody.addEventListener("keydown", resize, false); |
OlderNewer