Skip to content

Instantly share code, notes, and snippets.

{
"nonce": "0x0000000000000042",
"difficulty": "0x40000",
"alloc": {
"bbbbbaaaaa82db86a35502193b4c6ee9a76ebe8f": {
"balance": "10015200000000000000000"
}
},
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
class Media
belongs_to :mediable, :polymorphic => true
end
class Project
has_many :media, :as => :mediable
end
class Post
has_many :media, :as => :mediable
#!/usr/bin/env ruby
#
# usage: script/server_restarter
#
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+
# is so fast when completely reloading the server, I wrote this script to listen to the
# given directories, and kill/restart the server when any file is changed.
#
# It's quick, simple, and it reliably reloads your application when changes are made.
#
class SimpleMailer
require 'net/smtp'
attr_accessor :email_from, :email_to
def initialize(email_from, email_to)
@email_from, @email_to = email_from, email_to
end
def happy_mail
message = <<MSG
@maran
maran / Unattended Rails (Passenger, Ruby Enterprise) Stack
Created December 17, 2008 20:24
Unattended Rails (Passenger, Ruby Enterpise) Stack
#!/bin/bash
# Unattended REE/Passenger installation
# Source: http://weblog.brightlight-ict.nl/2008/12/unattended-passenger-ruby-enterprise-installation-on-ubuntu-8/
# 15/03/09 Updated to use latest r.e.e. and passenger 2.1 and rewrote bits thanks to the comments left on my blog. Thanks guys
if [ "$(whoami)" != "root" ]; then
echo "You need to be root to run this!"
exit 2
fi
Verifying that +maran is my Bitcoin username. You can send me #bitcoin here: https://onename.io/maran
#!/bin/bash -i
# This script will install Ethereum-Go and all dependencies.
# Please download and make it executable and run it as such to make sure the script reloads bashrc
# wget https://gist.github.com/maran/2d69089ed5ea3f83fde8 -O install
# chmod +x install
# ./install
if ! lsb_release -sr | grep 14.04 > /dev/null; then
echo "This script is made for Ubuntu 14.04, this probably won't work."
echo -p "Do you want to try it anyway? (y/n) " -n 1 -r
@maran
maran / install
Last active August 29, 2015 14:01
Ubuntu 14.04 Ethereum Go install
#!/bin/bash -i
# This script will install Go & QML
# Please download and make it executable and run it as such to make sure the script reloads bashrc
# wget https://gist.githubusercontent.com/maran/8dc397ed79331f16e284/raw -O install
# chmod +x install
# ./install
VERSION="1.2.2"
function fromPkg(){
sudo apt-get install -y golang