Different services I can suggest when a non-tech friend or family member asks me how they can cheaply make a website and possibly use it to sell stuff online.
Website Hosting
--- a/site-cookbooks/monit/templates/default/memcached.conf.erb | |
+++ b/site-cookbooks/monit/templates/default/memcached.conf.erb | |
@@ -2,5 +2,5 @@ check process memcached | |
with pidfile /var/run/memcached.pid | |
start program = "/etc/init.d/memcached start" | |
stop program = "/etc/init.d/memcached stop" | |
- if failed port 11211 protocol memcache 4 times within 6 cycles then restart | |
+ if failed port 11211 4 times within 6 cycles then restart | |
if 5 restarts within 5 cycles then timeout |
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
var Circle = function(options){ | |
var private = { | |
privateSecretToken: "this is a secret" | |
}; | |
return new (Backbone.Model.extend({ | |
initialize: function(){ | |
console.log(""); |
Different services I can suggest when a non-tech friend or family member asks me how they can cheaply make a website and possibly use it to sell stuff online.
Website Hosting
$font-color: red; | |
div.red { color: $font-color; } | |
$font-color: blue; | |
div.blue { color: $font-color; } |
require 'thread' | |
require 'benchmark' | |
N = 33 | |
NUM_THREADS = 16 | |
def fib(n) | |
if n == 0 | |
0 | |
elsif n == 1 |
#!/usr/bin/env ruby | |
require 'rails' | |
require 'rails/generators' | |
# Set up a fake Rails app. | |
# Hey, don't diss me. This is how Rails itself does. | |
# Checkout railties/test/abstract_unit.rb | |
class Generator < Rails::Application | |
config.generators do |g| | |
g.orm :active_record |
describe SomeClass do | |
freeze { 1.day.from_now } | |
it "does some stuff with time" do | |
end | |
end | |
# this actually does... | |
describe SomeClass do | |
around { |example| Timecop.freeze(1.day.from_now, &example) } |
This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.
OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.
require 'rubygems' | |
require 'eventmachine' | |
require 'em-http' # gem install em-http-request | |
require 'yajl' # gem install yajl-ruby | |
class String | |
def bold | |
"\033[1m#{self}\033[0m" | |
end | |
end |