Link archive.
LinkedIn: https://www.linkedin.com/in/welchjason
Blog: http://xealgo.tumblr.com/
Github: https://github.com/xealgo
var stagePos = smClient.felt.script.position; | |
var pos = { | |
top : stagePos('top',-200), | |
left: 0 | |
} | |
var index = 0; | |
var cards = _.clone(smClient.game.cards); | |
for(var card, f = 0; f < action.finalHand.length; f++) { |
var Person = function(params) { | |
this.name = ""; | |
this.age = 0; | |
this.gender = "na"; | |
_.extend(this, _.pick(params, _.keys(this))); | |
}; | |
var jason = new Person({ | |
name: "Jason", |
// bacon.fromPromise wrapper | |
let request = function(data) { return Bacon.fromPromise($.ajax(data.url)); } | |
// userdata event stream - sends github api request each time the username text field looses focus. | |
let userdata = $("#username").asEventStream("blur").map(function(event) { | |
let user = $(event.target).val(); | |
return {url: `https://api.github.com/users/${user}`}; | |
}).flatMap(request).log("user stream"); | |
// handle the data response that "request" made. |
package search | |
import ( | |
"reflect" | |
"strings" | |
) | |
// Build creates a map[string]interface object from a given | |
// struct based on tags. | |
func Build(tagName string, model interface{}) map[string]interface{} { |
Link archive.
LinkedIn: https://www.linkedin.com/in/welchjason
Blog: http://xealgo.tumblr.com/
Github: https://github.com/xealgo
#!/usr/bin/env ruby | |
FORBIDDEN = [ | |
/debugger/i, | |
/fuck/i, | |
/shit/i, | |
/bitch/i, | |
/wtf/i, | |
/fmt.Println/i, | |
/fmt.Printf/i, |
// IsPermutation checks permutations in strings of a-z in O(n) time. | |
// O(n+n) since both a & b must be the same length. | |
func IsPermutation(a, b string) bool { | |
al, bl := len(a), len(b) | |
if al != bl { | |
return false | |
} | |
var checker [2]int |
/////////////////////////////////////////////////////// | |
// solution for the With Google code challenge. | |
// https://techdevguide.withgoogle.com/paths/advanced/compress-decompression/#code-challenge | |
// by xealgo | |
// | |
// TODO: currently doesn't allow for numbers to be treated as string values, | |
// only to denote repetitions as per the rule: | |
// * Digits are only to represent amount of repetitions. | |
// but adding it would be pretty trivial though. | |
/////////////////////////////////////////////////////// |