This file contains 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 Thing | |
def wobble | |
'wobble wobble honk' | |
end | |
end | |
class ThingTest | |
def self.test(name, &block) | |
define_method(:"test #{name}", &block) | |
end |
This file contains 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
import java.util.NavigableMap; | |
import java.util.Random; | |
import java.util.TreeMap; | |
public class WeightedCollection<E> { | |
private NavigableMap<Integer, E> map = new TreeMap<Integer, E>(); | |
private Random random; | |
private int total = 0; | |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JQuery Demo</title> | |
<style type="text/css" media="screen"> | |
#the-box { | |
padding: 1em; | |
background-color: lightblue; | |
} |
This file contains 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 'bundler/inline' | |
gemfile do | |
gem 'wonder-llama', github: 'raws/wonder-llama', branch: 'master', require: 'wonder_llama' | |
end | |
def bot_mentioned?(message) | |
message.content.include?('@**Ralph**') | |
end |
This file contains 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
5.times do | |
print "I am a giant bucket" | |
end |
This file contains 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
######################################### | |
### Install wget-ssl over ipkg's wget ### | |
######################################### | |
$ ipkg install -verbose_wget libidn # To get ipk URL | |
$ ipkg install -verbose_wget wget-ssl # To get ipk URL | |
$ /usr/syno/bin/wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/libidn_1.25-1_i686.ipk | |
$ /usr/syno/bin/wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/wget-ssl_1.12-2_i686.ipk | |
$ ipkg install libidn_1.25-1_i686.ipk | |
$ ipkg install wget-ssl_1.12-2_i686.ipk |
This file contains 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
[['foo', 'bar', 'baz']].each { |array| puts array.inspect } | |
#=> ["foo", "bar", "baz"] | |
[['foo', 'bar', 'baz']].each do |first, second, third| | |
puts first.inspect | |
puts second.inspect | |
puts third.inspect | |
end | |
#=> "foo" | |
#=> "bar" |
This file contains 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 PumpkinCollection | |
def initialize(colors) | |
@colors = colors | |
end | |
def each | |
i = 0 | |
while i < @colors.length do | |
color = @colors[i] |
This file contains 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
workers Integer(ENV.fetch('WEB_CONCURRENCY', '2')) / 2 | |
threads_count = ENV.fetch('RAILS_MAX_THREADS', '2') | |
threads threads_count, threads_count | |
preload_app! |
This file contains 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 | |
# | |
# downcase PATH | |
# | |
# Recursively convert all file names contained in the given directory | |
# tree (but excluding the given directory itself) to lowercase. | |
# Existing files which are named identical to new, lowercased file | |
# names will be clobbered. | |
# | |
# Author: Ross Paffett <ross@rosspaffett.com> |
NewerOlder