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 isHash(obj) { | |
return typeof(obj) == "object" && Object.prototype.toString.call(obj) != "[object Array]"; | |
} |
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 fixed(float, decimal) { | |
decimal = decimal==undefined || decimal < 0 ? 2 : decimal; | |
return Math.round(float*Math.pow(10, decimal)).toString() | |
.replace((new RegExp("(\\d{"+decimal+"})$")), "$'.$1") | |
.replace(/^(-?)(\.)/, "$10.") | |
.replace(/^0$/, '0.00') | |
})(1.495) |
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
# Create a new stack | |
heroku create --stack cedar | |
# it will reply something like this | |
# Creating stark-moon-1526... done, stack is cedar | |
# http://stark-moon-1526.herokuapp.com/ | git@heroku.com:stark-moon-1526.git | |
# Change repository URL | |
git remote set-url heroku git@heroku.com:stark-moon-1526.git |
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
var port = process.env.PORT || 3000; | |
app.listen(port); |
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
var myApplication = {}; | |
myApplication.instance = { | |
msg : "Hello world!", | |
hello : function() { | |
alert(myApplication.instance.msg); | |
} | |
} | |
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
var myApplication = {}; | |
myApplication.instance = (function() { | |
var i = { | |
msg : "Hello world!", | |
hello : function() { | |
alert(i.msg); | |
} | |
}; | |
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
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' |
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
git clone git://git.sv.gnu.org/weechat.git | |
git checkout -b v0.4.2 v0.4.2 | |
sudo apt-get install libncursesw5-dev libcurl4-gnutls-dev zlib1g-dev libgcrypt11-dev | |
mkdir build | |
cd build | |
cmake .. -DPREFIX=/path/to/weechat | |
make | |
make install |
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
select book.contentid as bookid, book.title, b.bookmarkid, b.text, b.annotation | |
from bookmark b | |
inner join content c on b.contentid = c.contentid | |
inner join content book on c.bookid = book.contentid | |
order by book.datelastread desc, b.datecreated |
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
["The value of", property, "is", value].join(" ") |
NewerOlder