Skip to content

Instantly share code, notes, and snippets.

View darthschmoo's full-sized avatar

Bryce Anderson darthschmoo

View GitHub Profile
andersbr@lappy486:~/prog/ruby/final_fantasy_ultimate$ git clone http://github.com/shawn42/free-radicals/tree/master
Initialized empty Git repository in /home/andersbr/prog/ruby/final_fantasy_ultimate/master/.git/
error: File 0000000000000000000000000000000000000000 (http://github.com/shawn42/free-radicals/tree/master/objects/00/00000000000000000000000000000000000000) corrupt
Getting pack list for http://github.com/shawn42/free-radicals/tree/master
Getting alternates list for http://github.com/shawn42/free-radicals/tree/master
Also look at "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona
Also look at <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lan
Also look at <link rel="fluid-icon" href="http://github.com/fluidicon.png" title="Git
Also look at <link href="http://assets0.github.com/stylesheets/bundle.css?e06bdeb610e33dc41002eaa80ce09d26ae153090" media="screen" rel="stylesheet" type="text/
Also look at <script src="http://assets2.github.com/javascripts/bundle.js?e06bdeb610e33
class Card < ActiveRecord::Base
named_scope :exclude, lambda { |ids|
{ :conditions => ["id NOT IN(?)", ids] }
}
# This approach doesn't work when chained to other scopes that limit the number
# of rows, because count returns a count of all rows.
# named_scope :random, lambda {
# { :offset => rand(count), :limit => 1 }
# }
@darthschmoo
darthschmoo / gist:5205696
Last active December 15, 2015 04:59
Ruby: Trying to add some decorations to core classes, but only have them apply within a specific module.
# The result I'm looking for
module Herp
"".respond_to?( :whizbangify ) # true
File.respond_to?( :take_ownership ) # true
end
"".respond_to?( :whizbangify ) # false
File.respond_to?( :take_ownership ) # false
This is a file
==============
**silent**: But _bold_! [Link](http://slashdot.org)
@darthschmoo
darthschmoo / gist:6251759
Last active December 21, 2015 04:48
How to set up an empty vserver in DigitalOcean.
Create droplet
log in
change password for root (passwd)
# Alter default useradd behavior:
useradd -D -s /bin/bash
create user andersbr (useradd -m andersbr)
change password for andersbr (passwd)
add to sudoers file
@darthschmoo
darthschmoo / gist:8359447
Created January 10, 2014 18:09
Ruby code: If anyone needs help generating their Amazon AuthorRank for the day.
module ChuckWendig
class AuthorRankGenerator
def initialize
@mood = %w(belated confused morose unwell insipid thoughtful incontinent chewy bratty arrogant untrustworthy
awestruck inebriated love-starved overwrought merciful doubtful analytical self-assured simplistic
enraged melancholy lustful depressed)
@descriptor = %w(fighting dancing stammering boiling endearing staggered judicious internal heat-loving
ragtime kleptomaniacal torrential climate-changing self-help razor-edged killer caffeinated
pugilistic bitcoin luddite libertarian progressive leftist right-wing patriotic unpatriotic

Keybase proof

I hereby claim:

  • I am darthschmoo on github.
  • I am darth_schmoo (https://keybase.io/darth_schmoo) on keybase.
  • I have a public key whose fingerprint is 8996 1066 CA78 3E67 78E8 9D75 512B E81A 8D94 CA49

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<title> example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
<!DOCTYPE html>
<html>
<head>
<title> example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
<!DOCTYPE html>
<html>
<head>
<title> example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;