Skip to content

Instantly share code, notes, and snippets.

View 3den's full-sized avatar

Marcelo Eden 3den

View GitHub Profile
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/staging_development/workspace
Performing Post build task...
Match found for : : True
Logical operation result is TRUE
Running script : /home/wbrent/scripts/jenkins/deploy_staging_development.sh
[workspace] $ /bin/sh -xe /tmp/hudson6604474686417610329.sh
+ /home/wbrent/scripts/jenkins/deploy_staging_development.sh
BUNDLER is installing the Ruby gems: bundle install --without test development
Using rake (0.9.2.2)
@3den
3den / gist:6455996
Last active December 22, 2015 09:59
def hashfy(array)
array.size > 1 ? {array.shift => hashfy(array)} : array.shift
end
require "minitest/autorun"
describe "#hashfy" do
it "converts an array to a nested hash" do
hashfy([:animal, :dog]).must_equal({animal: :dog})
hashfy([:animal, :mammal, :dog]).must_equal({animal: {mammal: :dog}})
@3den
3den / bayes.js
Created October 26, 2013 09:19
bayes network
var Bayes = (function(){
function constructor(positives, negatives) {
this.positives = positives;
this.negatives = negatives || reverse(positives);
}
function compute(probabilities) {
return probabilities.reduce(function(previous, current){
return previous * current;
}, 1);
describe "it creates the correct wrapper object", ->
assertCount ({
"count": 25,
"key": "e114644",
"length": 25,
"name": "Heavy Rotation Station"
}, 25 );
@3den
3den / gist:8409977
Created January 13, 2014 23:15
hanoi
class Tower
def initialize(name, rings)
@name = name
@rings = rings
end
def to_s
@name
end
@3den
3den / SassMeister-input.scss
Created December 11, 2014 18:05
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$list: (
(a: ".div-1", b: (a: 100px)),
(a: ".div-2", b: (a: 200px)),
(a: ".div-3", b: (a: 300px)),
);
import {setEntries, next, vote, INITIAL_STATE} from './core';
// This is a polymorphic aprorach that conforms to all SOLID principles
// This reduce is much simpler and will raise an error if the action does not exist
export default function reducer(state = INITIAL_STATE, action) {
return action.handler(state, action.payload);
}
// This is the defensive version of the reducer above, if there is an error returns the current state
export default function maybeReducer(state = INITIAL_STATE, action) {
@3den
3den / mini-framework.js
Last active April 2, 2016 10:05 — forked from anonymous/index.html
basic Rx "state$"
// **** Framework *******
function createAction(reducer) {
const subject$ = new Rx.Subject();
return {
dispatch (payload) {
subject$.onNext(payload);
},
stream$: subject$.map((payload) => {
# this command syncs docker-machine running on virtualbox with your current working directory
# replace "/app/user" with the path where your app will be mounted on the docker container
# $(pwd) this will return your local folder and sync it with the equivalen folder on virtualbox
# make sure to stop your docker-machine before running this command
VBoxManage sharedfolder add DFC --automount --name /app/user --hostpath $(pwd)
$static-font-path: "salesforce-lightning-design-system/assets/fonts/webfonts/";
// This is needed to fix loadind fonts
// https://github.com/salesforce-ux/design-system/issues/71
@mixin set-slds-font($name, $file, $weight: 400, $style: normal) {
@font-face {
font-family: $name;
font-weight: $weight;
font-style: $style;
src: font-files(