- A web page is just a text file
- html > body > hello world
- definition of markup
- the HTML is invisible
- heading
#!/bin/bash | |
# to install, replace your .git/hooks/pre-commit with this file | |
if [ $staged_asset_count -gt 0 ]; then | |
if [ $changed_asset_count -eq 0 ]; then | |
echo "Packaging css/js assets with jammit..." | |
jammit -f | |
git add public/packaged # you might need to change this based on the package_path you use in your assets.yml | |
else |
# Entities | |
class Post | |
attr_accessor :id, :title, :link, :summary | |
attr_accessor :reactions | |
def score | |
self.reactions.inject(0){|r, sum| sum += r.score } | |
end | |
end |
var Foo; if (!Foo) Foo = {}; | |
// Then you can safely define things on Foobar: | |
Foo.Bar = function(){}; |
var Arch; if (!Arch) Arch = {}; // set up custom namespace 'arch' | |
Arch.Flash = { | |
showError: function(message) { | |
if (message == "") return; | |
$('#flash-msg .user-msg-detail').removeClass('notice'); | |
$('#flash-msg .user-msg-detail').addClass('error'); | |
$('#flash-msg .user-msg-detail span').html(message); | |
$('#flash-msg').show(); | |
}, |
var Arch; if (!Arch) Arch = {}; // set up custom namespace 'Arch' | |
Arch.AjaxPagination = function(paginationContainer, storiesContainer, filtersContainer) { | |
// Only html5 browsers can use ajax pagination. We don't want no stinkin' hashbang URLs. | |
if (!history.pushState) { | |
return; | |
} | |
this.$paginationContainer = $(paginationContainer); |
require 'iron_mq' | |
# IronMQ credentials | |
token = asdf | |
project_id = asdf | |
# each chatter needs their own queue | |
@fido = IronMQ::Client.new('token' => token, 'project_id' => project_id, :queue_name => "fido") | |
@red_rover = IronMQ::Client.new('token' => token, 'project_id' => project_id, :queue_name => "red_rover") |
module Sandbox | |
def self.add_class(klass) | |
const_set_from_string(klass) | |
end | |
def self.add_attributes(klass, *attrs) | |
self.const_get_from_string(klass).class_eval do | |
attr_accessor *attrs | |
# set up the 'initialize' method to assign the attributes |
if ENV['RAILS_ENV'] | |
rails_env = ENV['RAILS_ENV'].downcase | |
elsif Rails and Rails.env | |
rails_env = Rails.env.downcase | |
end | |
if rails_env | |
current_app = "myapp" | |
black = "\[\033[0;30m\]" |