Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -xvzf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125/ | |
./configure --prefix=/usr/local | |
make | |
make install |
defmodule JSON do | |
import String | |
def parse( content ) do | |
case parse_content(content) do | |
{ value, "" } -> value | |
{ _, _ } -> raise "crap" | |
end | |
end |
Usage example: | |
>> text = Morpher.new('Большой город') | |
{:Р=>"Большого города", :Д=>"Большому городу", :В=>"Большой город", :Т=>"Большим городом", :П=>"Большом городе", :П_о=>"о Большом городе", :род=>"Мужской", :множественное=>{:И=>"Большие города", :Р=>"Больших городов", :Д=>"Большим городам", :В=>"Большие города", :Т=>"Большими городами", :П=>"Больших городах", :П_о=>"о Больших городах"}, :где=>"в Большом городе", :куда=>"в Большой город", :откуда=>"из Большого города"} | |
>> text.singular('Д') | |
"Большому городу" | |
>> text.plural('Д') |
Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
var request = require('request'); | |
var consumer_key = 'YOUR_CONSUMER_KEY'; | |
var consumer_secret = 'YOUR_CONSUMER_SECRET'; | |
var enc_secret = new Buffer(consumer_key + ':' + consumer_secret).toString('base64'); | |
var oauthOptions = { | |
url: 'https://api.twitter.com/oauth2/token', | |
headers: {'Authorization': 'Basic ' + enc_secret, 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, | |
body: 'grant_type=client_credentials' | |
}; |
# verified to work on DigitalOcean Ubuntu 12.10 X32 Server instance | |
# prerequisites | |
sudo addroup admin | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev gcc git make zsh | |
chsh -s /bin/zsh | |
# oh-my-zsh | |
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh |
javascript: (function () { | |
function c() { | |
var e = document.createElement("link"); | |
e.setAttribute("type", "text/css"); | |
e.setAttribute("rel", "stylesheet"); | |
e.setAttribute("href", f); | |
e.setAttribute("class", l); | |
document.body.appendChild(e) | |
} | |
function h() { |
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>Terminal</appname> | |
<equal>com.apple.Terminal</equal> | |
</appdef> | |
<item> | |
<name>TMUX Key Remappings</name> | |
<item> | |
<name>TMUX: Right Control to Ctrl+B</name> |
You probably don't want Google crawling your development staging app. Here's how to fix that.
$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt
Now edit config/routes.rb
to add a route for /robots.txt
, and add the controller code.