Skip to content

Instantly share code, notes, and snippets.

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_4.x | bash -
apt-get install -y nodejs
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Monitor file changes
gem 'guard'
gem 'guard-livereload', '~> 2.4', require: false
gem 'rack-livereload'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
guard 'livereload' do
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/helpers/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
watch(%r{config/locales/.+\.yml})
# Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" }
end
# warning: Insecure world writable dir /var/www in PATH, mode 040777
# fix
chmod go-w /var/www
<div class="demo-container">
<h1 id="main-title">Foobar</h1>
<h3 id="sub-title">Lorem Ipsum dolor</h3>
</div>
var initialValues = {
y:40,
opacity:0
}
var mainTitleActor = new ui.Actor({
element: "#main-title",
values: initialValues
});
var showUpTween = new ui.Tween({
values: {
y: 0,
opacity: 1
},
duration:600
});
var sequence = new ui.Sequence();
sequence.clear()
.do(this.mainTitleActor, this.showUpTween)
.at('+=150')
.do(this.subTitleActor, this.showUpTween)
.start();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QUnit Example</title>
<link rel="stylesheet" href="http://{path-to-your-install}/qunit/qunit-1.15.0.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
test("division_parse", function(assert) {
var result = DivisionHelper.parse('1/2');
assert.equal(result, 0.5)
});