Skip to content

Instantly share code, notes, and snippets.

mike suarez msuarz

Block or report user

Report or block msuarz

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
loadTasks = require 'load-grunt-tasks'
module.exports = (grunt) ->
env = process.env
cwd = process.cwd()
root = "#{cwd}/../../go"
src = "#{root}/src/#{env.src}"
command = (cmd, opts) ->
command: cmd
msuarz / music.rb
Last active Aug 29, 2015
music folder cleanup
View music.rb
#encoding: IBM437
require 'rake'
require 'fileutils'
task :clean, :folder do |t, args|
task :biggie, :folder do |t, args|
msuarz / zip.rb
Last active Dec 25, 2015
zip it baby
View zip.rb
(0..servers.count - 1).each { |i| servers[i][:ip] = ips[i] }
servers.each_with_index { |server, i| server[:ip] = ips[i] }
#beautiful { |server, ip| server[:ip] = ip }
View before_after.rb
# before
while @servers.collect { |server| server.done? }.include? false
# after
until servers.all? &:done? do
fs = require 'fs'
rawData = fs.readSync process.stdin.fd, 100, 0, 'utf8'
@lines = rawData[0].split '\r\n'
View gist:5062044
wd = require('wd');
browser = wd.remote 'localhost', 9134
products = []
browser.init ->
browser.get "", ->
browser.elementById 'autocomplete_prod', (err, el)->
browser.clear el, (err)->
browser.type el, '3TL941C', (err)->
msuarz /
Created Jul 11, 2012
catching exceptions in callbacks
should = require 'should'
describe 'cool', ->
it 'is', (done) -> done()
it 'is not', (done) ->
process.nextTick ->
class exports.Login
'when a user logs in': -> true
'it should be greeted': -> true
'when #{user} logs in': (user) -> true
'it should say #{msg}': (msg) -> true
exports.benchmark = (user_options) ->
start user_options
queue = async.queue run, options.workers
queue.drain = finish
queue.push i for i in [1..options.runs]
async.series [
(done) -> fs.writeFile '/tmp/test', 'yay', ->
console.log 'yay!!'
done null
(done) ->
console.log 'hello'
done null
-> console.log 'world'
You can’t perform that action at this time.