Skip to content

Instantly share code, notes, and snippets.

View brntbeer's full-sized avatar
:shipit:

Brent Beer brntbeer

:shipit:
View GitHub Profile
@brntbeer
brntbeer / gist:201246
Last active July 22, 2019 21:17
lol a super old sinatra app that was going to be for pictures of really bad conference or hotel rugs
require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'haml'
require 'lib/models'
#just covering my bases!
['/', '/index/?', '/home/?'].each do |path|
get path do
redirect '/rugs/'
all: main
main: Simulator.o Environment.o Behavior.o Cell.o Circle.o Formation.o Neighborhood.o Robot.o Vector.o
g++ -framework OpenGL -framework GLUT -framework Cocoa Simulator.o Behavior.o Cell.o Circle.o Environment.o Formation.o Neighborhood.o Robot.o Vector.o -o Simulator
Simulator.o: Simulator.cpp
g++ -c Simulator.cpp
Behavior.o: Behavior.cpp
g++ -c Behavior.cpp
all: main
main: Simulator.o Environment.o Behavior.o Cell.o Circle.o Formation.o Neighborhood.o Robot.o Vector.o
g++ -framework OpenGL -framework GLUT -framework Cocoa Simulator.o Behavior.o Cell.o Circle.o Environment.o Formation.o Neighborhood.o Robot.o Vector.o -o Simulator
Simulator.o: Simulator.cpp
g++ -c Simulator.cpp
Behavior.o: Behavior.cpp
g++ -c Behavior.cpp
#!/usr/bin/env jruby
require "java"
include_class "processing.core.PApplet"
class Sketch < PApplet
def setup
size( 300, 300, P3D )
no_stroke
require 'benchmark'
def fib(n)
if n == 0 || n == 1
n
else
fib(n-1) + fib(n-2)
end
end
State(const Formation f = Formation(),
const Vector grad = Vector(),
const vector<Relationship> r = vector<Relationship>(),
const Vector tError = Vector(),
const GLfloat rError = 0.0f,
const GLint ts = 0,
const GLint rID = -1,
const vector<NCellMsg> msgs = vector<NCellMsg>())
: formation(f), gradient(grad), rels(r),
transError(tError), rotError(rError), tStep(ts), refID(rID),
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#

World famous FFFFFFFFUUUUUUUUU autotest-growl icon set

fucons

  1. download
  2. Edit your .autotest and add this line: Autotest::Growl::image_dir = File.expand_path("~")+'/Dropbox/Public/fu' (or wherever you unpacked fu.zip)
  3. ???????
  4. Profit!
require 'rubygems'
require 'net/http'
require 'json'
uri = URI.parse("http://fluttrly.com/bouverdafs") #=> should be a valid task ID
http = Net::HTTP.new(uri.host, uri.port)
response = http.request(Net::HTTP::Get.new(uri.request_uri))
# Use the get response above to get an auth token and cookie