Skip to content

Instantly share code, notes, and snippets.

# == Schema Information
#
# Table name: vouchers
#
# id :integer not null, primary key
# client_id :integer
# code :string(255)
# claimed :boolean default(FALSE)
# claimed_at :datetime
# created_at :datetime not null
class VouchersController < ApplicationController
layout "widescreen"
def index
@vouchers = Voucher.search(params[:search], params[:page]).per_page(30)
respond_to do |format|
format.html {redirect_to(@vouchers[0]) if @vouchers.length == 1}
format.json { render json: @vouchers }
end
# SMS voucher system
def voucher
p = params
twilio_number = "+441257733073"
# Removes the +44 and replaces it with 0
number = p["From"].gsub("+44", "0")
# Splits "wormer 1" and "wormer1"
Apr 14 14:53:20 eccleston snmpd[2238]: IfIndex of an interface changed. Such interfaces will appear multiple times in IF-MIB.
Apr 14 14:53:20 eccleston openvpn[1643]: write UDPv4 []: Network is unreachable (code=128)
Apr 14 14:53:20 eccleston openvpn[1643]: write UDPv4 []: Network is unreachable (code=128)
Apr 14 14:53:21 eccleston pppd[1290]: Timeout waiting for PADO packets
Apr 14 14:53:22 eccleston openvpn[1643]: write UDPv4 []: Network is unreachable (code=128)
Apr 14 14:53:53 eccleston openvpn[1643]: last message repeated 67 times
Apr 14 14:54:18 eccleston openvpn[1643]: last message repeated 36 times
Apr 14 14:54:18 eccleston openvpn[1643]: Inactivity timeout (--ping-restart), restarting
Apr 14 14:54:18 eccleston openvpn[1643]: TCP/UDP: Closing socket
Apr 14 14:54:18 eccleston openvpn[1643]: Closing TUN/TAP interface

Keybase proof

I hereby claim:

  • I am dannymcc on github.
  • I am dannymcc (https://keybase.io/dannymcc) on keybase.
  • I have a public key whose fingerprint is 281E 8F27 58E2 4A93 6FC6 7B23 5C9B D16B 6DF1 6E7C

To claim this, I am signing this object:

#
# Voupe Rails Template
# http://r.dean.io
# rails new awesome -d mysql --skip-spring -m http://rails.dean.io
# http://guides.rubyonrails.org/rails_application_templates.html
#
RUBY_VERSION = "2.1.5"
#
echo "
clear
echo "$(tput setaf 1)
_____ _ _ _ _ _____ _ _ _____ _ _ _
| | |_| | |___ ___ ___ ___| |_ | _ |___|_|_____ ___| | | | |___ ___ ___|_| |_ ___| |
| | | | | _| _| -_|_ -| _| | | | | | .'| | | | . |_ -| . | | _| .'| |
|__|__|_|_|_|___|_| |___|___|_| |__|__|_|_|_|_|_|_|__,|_| |__|__|___|___| _|_|_| |__,|_|
|_| "
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
@dannymcc
dannymcc / gist:60b41d888ad8520eb289
Created March 21, 2015 19:41
dan@dannyweb.net GPG Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mQENBFOI3nkBCACc+5potLpy55GgSggBMYCTHFYww/wQnbRUilIe5wv7SXZ+RBrv
eXv+JIuUpa5w/rr5CZP2rF1fLE57djfkveEguwemMrEKbLRB+I4w6CpkzyntrBIK
YNXUYlY9H1B7XwnhL0JUxS/K7ocUPQ+16STRxGxWzl/uKwrWs8+DRcKNOmGMd82Z
1gK89pKghCTXtFijZvWeC+BP/UIlPtioQO0qH7fy0LnByW01z2HKHV5DF/ujeWTA
uYUDRnR/Ma/uNaNGozNF8NZxPNz9B4vhevNUuMbNSwc1bBxgrGs4xXDxzXOQeXuH
34z6uhZkKlsUaRaVQehdWvZIot9nPrjkJmsXABEBAAG0I0Rhbm55IE1jQ2xlbGxh
bmQgPGRhbkBkYW5ueXdlYi5uZXQ+iQE9BBMBCgAnBQJTiN55AhsDBQkHhh+ABQsJ
# GET /people/1
# GET /people/1.xml
def show
@person = Person.find(params[:id])
@kases= @person.kases(:all)
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @person }
format.mobile
>> now = Time.now
>> now.to_s
# => "Mon Mar 05 18:30:48 2007"
>> now.to_s(:db)
# => "2007-03-05 18:30:48"
>> now.to_s(:short)
# => "05 Mar 18:30"
>> now.to_s(:long)
# => "March 05, 2007 18:30"
>> now.to_s(:rfc822)