Skip to content

Instantly share code, notes, and snippets.

View seabre's full-sized avatar

Sean Brewer seabre

  • CrowdFiber
  • Chattanooga, TN
View GitHub Profile
@seabre
seabre / devise_login_rails_console.rb
Created June 1, 2012 20:51
Devise Login Through Rails Console
ApplicationController.allow_forgery_protection = false
app.post('/whatever_my_user_model_is/sign_in', {"whatever_my_user_model_is"=>{"email"=>"users@email.com", "password"=>"users_password"}})
@seabre
seabre / deploy_dandelion.sh
Created September 24, 2013 19:45
Dandelion Deployment
# Dandelion, deploy on production
dandelion deploy
# Dandelion, deploy on staging
dandelion --config=dandelion_staging.yml deploy
@seabre
seabre / three.cljs
Last active September 13, 2021 06:19 — forked from michiakig/three.cljs
Three.js demo with ClojureScript. Actually works.
(ns three.demo)
(def THREE js/THREE)
(def camera (THREE.PerspectiveCamera. 75 (/ (.-innerWidth js/window)
(.-innerHeight js/window)) 1 10000))
(set! (.-z (.-position camera)) 1000)
(def scene (THREE.Scene.))
(def geometry (THREE.CubeGeometry. 200 200 200))
(def obj (js/Object.))
(set! (.-color obj) 0xff0000)
(set! (.-wireframe obj) true)
@seabre
seabre / random_password.js
Created September 19, 2011 21:21
Random Password Generator (Bookmarklet Version)
(function(){var a=[["0","1","2","3","4","5","6","7","8","9"],["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]];pass="";for(var b=8;b>0;b--){var c=a[Math.floor(Math.random()*a.length)];pass+=c[Math.floor(Math.random()*c.length)]}prompt("Random Password:",pass)})();
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@seabre
seabre / blumblumshub.coffee
Created April 15, 2012 03:52
Blum Blum Shub Pseudo Random Number Generator
# An implementation of assert.
AssertException = (message) ->
@message = message
assert = (exp, message) ->
throw new AssertException(message) unless exp
AssertException::toString = ->
"AssertException: " + @message
@seabre
seabre / cur_time_sql.rb
Created December 7, 2011 19:58
Format Time in Ruby for SQL Datetime Comparison
#Gets current time, then formats current time for SQL.
Time.now.to_s(:db)
@seabre
seabre / keybase.md
Created April 9, 2017 02:59
keybase.md

Keybase proof

I hereby claim:

  • I am seabre on github.
  • I am seabre (https://keybase.io/seabre) on keybase.
  • I have a public key ASAaOh0ptPfmijH6a1GK0NpdzmDwAaGSvkRwKYtow96jNAo

To claim this, I am signing this object:

var yourself = {
fibonacci_lookup : {0: 0, 1: 1},
fibonacci : function(n) {
if (this.fibonacci_lookup[n] !== undefined) {
return this.fibonacci_lookup[n];
}
else {
var result = this.fibonacci(n - 1) +
this.fibonacci(n - 2);