Skip to content

Instantly share code, notes, and snippets.

View Opus1no2's full-sized avatar
🏠
Working from home

Travis Tillotson Opus1no2

🏠
Working from home
View GitHub Profile
for (var i = 1; i <= 100; i++) {
if (i % 15 === 0) {
console.log('FizzBuzz');
} else if (i % 3 === 0) {
console.log('Fizz');
} else if (i % 5 === 0) {
console.log('Buzz');
} else {
console.log(i);
}
@Opus1no2
Opus1no2 / rules.js
Created June 30, 2014 14:31
poc for dynamic instantiation of OOo object
var conf = {
tab: {
tab: {
},
customVariables: {
foo: 'bar'
}
},
floating: {
(function (w, o) {
w.oo_tab = new o.Ocode({
tab:{},
customVariables: {
yourParameterName: 'Your value',
anotherParamName: 'Another value',
aCookieValue: o.readCookie('cookie_name') || ''
}
});
})(this, OOo);
var conf = {
tab: {
tab: {
customVariables: {
foo: 'bar'
}
}
},
floating: {
floating: {
@Opus1no2
Opus1no2 / opcode
Last active August 29, 2015 14:02
#!/usr/bin/env ruby
#
# This script uses command line args 'valid_args' to
# create valid code/extranet packages
#
# place this script in /usr/local/bin
#
# usage:
# opcode t i b
#
@Opus1no2
Opus1no2 / bind.js
Created June 11, 2014 18:54
Bind POC
// Reusable constructor function for prototype setting.
var Ctor = function(){};
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
// available.
var OOo = {};
OOo.bind = function(func, context) {
var args,
bound,
@Opus1no2
Opus1no2 / Gruntfile.js
Created April 24, 2014 16:03
Gruntfile.js
module.exports = function(grunt) {
// Files to be concatinated
var srcFiles = [
'src/intro.js',
'src/utilities.js',
'src/utilities/tunnel.js',
'src/utilities/sha1.js',
'src/utilities/abandonment.js',
'src/utilities/thirdPartyCookies.js',
module.exports = function(grunt) {
var srcFiles = [
'src/intro.js',
'src/utilities.js',
'src/utilities/tunnel.js',
'src/utilities/sha1.js',
'src/utilities/abandonment.js',
'src/utilities/thirdPartyCookies.js',
'src/cookie.js',
@Opus1no2
Opus1no2 / 177
Created April 4, 2014 20:01
177
(fn [s]
(empty?
(loop [s (clojure.string/replace s #"[^\(\)\{\}\[\]]" "")]
(let [r (clojure.string/replace s #"\(\)|\{\}|\[\]" "")]
(if (= r s) s (recur r))))))
/*global OOo*/
var customVar;
var oo_tab = new OOo.Ocode({
customVariables: {
var1: (customVar !== undefined) ? customVar : ''
}
});