Skip to content

Instantly share code, notes, and snippets.

debugger
puts
show me the page
console.log
- :provider: google
:key: teambox.com
:secret: blablabla
:scope: 'https://docs.google.com/feeds/ https://www.google.com/calendar/feeds/ https://www.google.com/m8/feeds/ https://mail.google.com/mail/feed/atom/'
- :provider: google_apps

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

// Build the https based part & read the key and crt file that is required to encrypte the server / client connection
var ssl = https.createServer({
key: fs.readFileSync( "./ssl/ssl.private.key" ).toString()
, cert: fs.readFileSync( "./ssl/ssl.crt" ).toString()
});
// This is the part what it's all about, we are going to route all
// https based requires to the default app handler
ssl.addListener( "request", function sllRequestListener( req, res ){
req.ssl = true; // just add an extra flag so we can see if it was forwarded from https
@saimonmoore
saimonmoore / bash function: execute command n times
Created March 31, 2011 22:13
A bash function that executes a command n (default 5) times
# Usage:
# $loopc echo 'hello world'
# hello world
# hello world
# hello world
# hello world
# hello world
#
#(i.e. defaults to 5 iterations)
Receivd.app froze while unpacking the dmg.
Killed Finder.app but that didn't solve it.
Had to manually kill the disk image mount process.
Then I couldn't start up Finder.app.
Then I couldn't access /Volumes.
I then had to restart my machine to get Finder.app running again.
@saimonmoore
saimonmoore / gist:887733
Created March 25, 2011 22:08
opscode nginx recipe
include_recipe "build-essential"
include_recipe "runit"
%w{ libpcre3 libpcre3-dev libssl-dev}.each do |devpkg|
package devpkg
end
nginx_version = node[:nginx][:version]
configure_flags = node[:nginx][:configure_flags].join(" ")
node.set[:nginx][:daemon_disable] = true
unless platform?("centos","redhat","fedora")
runit_service "nginx"
service "nginx" do
subscribes :restart, resources(:bash => "compile_nginx_source")
end
else
#from:
#chef deploy resource callback
before_symlink do
rails_env = node["environment"]["framework_env"]
run ". /etc/profile; cd #{release_path} && bundle exec rails runner 'Sprocket.configurations.each { |c| Sprocket.new(c).install_script }' RAILS_ENV=#{rails_env}"
end
#to:
before_symlink do
e = execute "source system profile" do
user node[:unix_user]
command ". /etc/profile"
action :nothing
end
bash "set ruby enterpise as default ruby" do
user "root"
code <<-EOH
echo "PATH=#{node["ruby_enterprise"]["install_path"]}/bin:$PATH" >> /etc/profile