Skip to content

Instantly share code, notes, and snippets.

info: Welcome to Nodejitsu nicohvi
info: jitsu v0.13.14, node v0.10.15
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in coffee marvin.coffee
debug: { method: 'GET',
debug: uri: 'https://api.nodejitsu.com/apps/nicohvi/marvin',
debug: headers:
debug: { Authorization: '*****************************************************************',
debug: 'Content-Type': 'application/json',
ReactTransition = React.addons.CSSTransitionGroup
Component = React.createClass
displayName: 'component'
render: ->
section className: 'component',
ReactTransition transitionName: 'fadeIn',
SubComponent()
@nicohvi
nicohvi / hof.js
Last active August 29, 2015 14:05
Functional programming
function whosTopDog(dogs, comparison) {
for (var i=0; i < dogs.length; i++) comparison(dogs[i]);
}
whosTopDog(['ice cube', '50 cent', 'snoop'], function(dog) {
if(dog === 'snoop dog') {
console.log(dog+ ' is top deg.');
}
else {
console.log(dog+ ' is a bitch.');
while true do
p 'You done fucked up son'
end
Given /^the person "(.*?)" should not be "(*.?)"$/
@nicohvi
nicohvi / sprockets.rb
Created November 7, 2014 08:48
Ruby script for compiling haml and coffeescript
require 'haml'
require 'coffee-script'
@root = Dir.pwd
@coffee = "#{@root}/_coffee"
@haml = "#{@root}/_haml"
def compile_coffeescript
target, javascript = "#{@root}/public/application.js", '' # 1
Dir.glob("#{@coffee}/*.coffee") do |coffeescript| # 2
require 'listen'
require 'haml'
require 'coffee-script'
require 'uglifier'
@root = Dir.pwd
@haml = "#{@root}/_haml"
@coffee = "#{@root}/_coffee"
def compile_haml(file)
require 'minitest/autorun'
require 'byebug'
def stack_machine(string)
result = []
numbers = []
string.split.each do |token|
if /(\d)/.match(token)
numbers << Integer(token)
var responseMetastream = requestStream
.map(function(requestUrl) {
return Rx.Observable.fromPromise(jQuery.getJSON(requestUrl));
});
# variables
movieButton = $('#movie-button')
errorField = $('.error')
movieField = $('.movies')
movieTemplate = Handlebars.compile($('#movie-template').html())
# functions
createClickStream = ->
movies = $('.movie')
clickStream = Rx.Observable.fromEvent movies, 'click'