This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Cinch | |
module Plugins | |
class PluginWatcher | |
include Cinch::Plugin | |
def initialize(*args) | |
super | |
auto_reload_plugins | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ri 'Array#<=>' | |
= Array#<=> | |
(from ruby site) | |
------------------------------------------------------------------------------ | |
ary <=> other_ary -> -1, 0, +1 or nil | |
------------------------------------------------------------------------------ | |
Comparison---Returns an integer (-1, 0, or +1) if this array is less than, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "account" do | |
context 'with no displayname' do | |
it 'can set display name' , :js => true, :slow => true do | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Wallet < ActiveRecord::Base | |
attr_accessible :cents, :margin_cents | |
belongs_to :user | |
def equity | |
margin + cash + user.stocks.mark_value | |
end #^ | |
# \ This is what I need access to | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3 (main):0 > numberize ['1','2.2','a', '-2'] | |
=> [ | |
[0] 1, | |
[1] 2.2, | |
[2] "a", | |
[3] -2 | |
] | |
1.9.3 (main):0 > numberize ['1','2.2','a', '-2', '-2.2'] | |
=> [ | |
[0] 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3 (main):0 > a | |
=> [ | |
[0] 1, | |
[1] "1", | |
[2] "1.1", | |
[3] "a", | |
[4] "-1", | |
[5] "-2.2" | |
] | |
1.9.3 (main):0 > b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: lighted | |
# Required-Start: $syslog $remote_fs $network | |
# Required-Stop: $syslog $remote_fs $network | |
# Should-Start: fam | |
# Should-Stop: fam | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start the lighted web server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server.modules = ( | |
"mod_access", | |
"mod_alias", | |
"mod_compress", | |
"mod_redirect", | |
"mod_rewrite" | |
) | |
server.document-root = "/var/www" | |
server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
open MIMETYPES, "/etc/mime.types" or exit; | |
print "mimetype.assign = (\n"; | |
my %extensions; | |
while(<MIMETYPES>) { | |
chomp; | |
s/\#.*//; | |
next if /^\w*$/; | |
if(/^([a-z0-9\/+-.]+)\s+((?:[a-z0-9.+-]+[ ]?)+)$/) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "#####" | |
echo "Core System Setup" | |
echo "#####" | |
echo "" | |
read -p "Set MySQL Root Password: " mysqlrootpass | |
# |