Skip to content

Instantly share code, notes, and snippets.

Brandon Henry bhenry

Block or report user

Report or block bhenry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bhenry
bhenry / jruby10.rb
Created Jul 29, 2016 — forked from IndianGuru/jruby10.rb
JRuby and Amazon S3
View jruby10.rb
require "rubygems"
require "bundler/setup"
require 'yaml'
require 'aws-sdk'
#require 'jruby-openssl'
bucket_name = "talim"
file_name = "jrubyaws.txt"
View gist:77ebb0a80d384884adf8
(ns om-life.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[om-life.events :as e :refer [publish! event]]
[sablono.core :as html :refer-macros [html]]))
(def seed
#{[8 13] [9 13] [4 11] [6 13] [8 14] [11 14] [4 12] [5 13]
[4 13] [14 14] [12 13] [15 14] [12 14] [14 13] [38 13]
[37 13] [34 13] [35 14] [4 14] [34 14] [5 14] [32 13]
View gist:2579fe49e06bf875ec55
(ns scoreboard.test
(:require [scoreboard.events :as e :refer [publish!]]
[scoreboard.core :as s]))
(def score-range (range 0 150))
(def timeouts-range (range 1 4))
(def paths-values
[[[:home :score] score-range]
[[:home :timeouts] timeouts-range]
View gist:5a80497fc2fa108e37c9
(defonce init
(reset! app-state
{:home {:home? true
:score 0
:timeouts 3}
:away {:home? false
:score 0
:timeouts 3}
:ball-on 50
:to-go 10
View csv.lua
-- Using lua to parse CSV file to a table.
-- Notice: first line must be data description filed.
-- The separator is '|', change it if you want.
-- Usage: csv = require('csv')
-- tab = csv.load('test.csv', ',')
-- table.foreach(tab[1], print)
-- print(tab[1].you_field)
--encoding=utf-8
@bhenry
bhenry / 20.php
Created May 1, 2012 — forked from anonymous/20.php
euler 20
View 20.php
<?php
function facto($x){
$r = 1;
for($i=$x;$i>1;$i--){
$r *= $i;
}
return $r;
}
View gist:1296675
=== public final java.lang.Class ===
[ 0] static forName : Class (String)
;;subset of (clojure.contrib.repl-utils/show Class)
;; how do i use forName method.
(.forName Class "mystringhere")
;;results in
View mapping_trouble.clj
(def nodes
{:k {:neighbors [:kaet] :activation 0.2}
:ae {:neighboars [:kaet] :activation 0.2}
:t {:neighbors [:kaet] :activation 0.2}
:kaet {:neighbors [:k :ae :t :cat] :activation 0.2}
:cat {:neighbors [:kaet] :activation 0.2}})
(map #(:activation (% nodes)) (-> nodes :kaet :neighbors))
View gist:713956
;; for 18 and 67 in project euler
(defn max-path-sum
"give it a vector of vectors that form a triangle"
([t] (max-path-sum t (- (count t) 2) (t (dec (count t)))))
([t top bot]
(if (> top 0)
(max-path-sum
t
(dec top)
(vec
View new_table.php
<?php
session_start();
$db = mysql_connect("localhost", "bdag", "bdag") or die("Could not connect.");
if(!$db)
die("no db");
if(!mysql_select_db("bdaginventory",$db))
You can’t perform that action at this time.