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
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
# vmc update is great for test and development, however it stops your old app and stages and starts the new one, | |
# resulting in dropped requests. | |
# If you want to update an application without dropping user requests, see below. | |
# NOTE: This change assumes your application can share services, etc with the new version. | |
# Assume my app is named foo | |
vmc push foo-v2 --url foov2.cloudfoundry.com |
var fs = require('fs'); | |
var child_process = require('child_process'); | |
var spawn = child_process.spawn; | |
function openEditor(file) { | |
var cp = spawn(process.env.EDITOR, [file], { | |
customFds: [ | |
process.stdin, | |
process.stdout, | |
process.stderr |
# minimal rails3 app | |
require 'action_controller' | |
Router = ActionDispatch::Routing::RouteSet.new | |
Router.draw do | |
root :to => 'site#index' | |
end | |
class SiteController < ActionController::Metal |
$ git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
#user nobody; | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; |
<style media="print"> | |
#printed-image { content: url(/path/to/image.png); } | |
</style> | |
<img id="printed-image" src="/images/spacer.gif"> |
In my previous post I described how to securely acquire the Mozilla list of root certificates and convert them to a form usable by curl and various libraries which don't ship with them.
Next, I want to point Net:HTTP
at this file library-wide, so that it is used by all invocations of methods accessing https resources (in particular, Kernel#open
, which in ruby 1.8.7 does not have a ca_file option and is therefore unusable with https). I hunted around the ruby standard library for a couple hours and came up with this:
require 'open-uri'
require 'net/https'
module Net
class HTTP
<!DOCTYPE> | |
<html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> | |
<div id="mensajes"> | |
Hola Mundo |
class OmniauthController < ApplicationController | |
def start | |
request_phase(:facebook, client_id, client_secret) | |
end | |
def callback | |
callback_phase(:facebook, client_id, client_secret) do | |
render :text => "Done!" | |
end | |
end |