Skip to content

Instantly share code, notes, and snippets.

unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'rack', github: 'rack/rack'
gem 'i18n', github: 'svenfuchs/i18n'
GEMFILE
system 'bundle'
https://auctionet.com/de?gclid=CKK21fmSuLwCFSoEwwodOlkABg
http://auctionet.com/search?is=&q=???ldre+m???stare+-hundra&utf8=?&utm_medium=campaign&utm_source=campaign293&utm_campaign=Kampanj+293%3A+%C3%84ldre+m%C3%A4stare
class Connection
# .. rest of the class .. #
def accept_connection(io)
@io = io
# new connection code
end
def to_io
class PodiumPosition
# .. behavior .. #
def to_int
@race_position
end
end
position = PodiumPosition.new(1)
prizes = [ "orange", "apple", "corn" ]
puts "Congrats, you won #{prizes[position]}"
static VALUE
rb_f_open(int argc, VALUE *argv)
{
ID to_open = 0;
int redirect = FALSE;
if (argc >= 1) {
CONST_ID(to_open, "to_open");
if (rb_respond_to(argv[0], to_open)) {
redirect = TRUE;
class VimConfig
# ... behaviour ... #
def to_path
"~/.vimrc"
end
end
config = VimConfig.new
config_file = File.open config
#!/usr/bin/env bash
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libyaml-dev libreadline-gplv2-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.bz2
tar -xvf ruby-1.9.3-p429.tar.bz2
cd ruby-1.9.3-p429/
./configure --prefix=/usr/local
sudo make
sudo make install
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Stack;
public class Main {
@victorarias
victorarias / gist:5164279
Created March 14, 2013 19:15
Evented (cool) collision system update
function CoolCollisionSystem() {
this.currentTime = 0;
this.pq = new PriorityQueue(eventComparator);
//warmup happens only at startup (duh), to predict collisions between every particle
//this is the only n^2 loop
this.warmUp = function() {
for(var i = 0, length = this.circles.length; i < length; i++) {
this.predict(this.circles[i]);
}
@victorarias
victorarias / gist:5163882
Last active December 14, 2015 23:09
Simple collision system update
function SimpleCollisionSystem() {
this.update = function update() {
for(var a = 0; a < this.circles.length; a++) {
var circle1 = this.circles[a];
//n * n/2 loop to check for collisions on every other particle
for(var b = a + 1; b < this.circles.length; b++) {
var circle2 = this.circles[b];
circle1.checkCollisionOnAnotherCircle(circle2);