This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
["Alice blue", "#F0F8FF"], | |
["Antique white", "#FAEBD7"], | |
["Aqua", "#00FFFF"], | |
["Aquamarine", "#7FFFD4"], | |
["Azure", "#F0FFFF"], | |
["Beige", "#F5F5DC"], | |
["Bisque", "#FFE4C4"], | |
["Black", "#000000"], | |
["Blanche dalmond", "#FFEBCD"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
arrays | |
*/ | |
const _set = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
const _set2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | |
/* | |
predicates | |
*/ | |
const isEven = x => x % 2 === 0; | |
const addOne = x => x + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function workerMessageHandler({ data, origin, lastEventId, source, ports }) { | |
console.warn(`worker got message | |
data: ${JSON.stringify(data)} | |
origin: ${origin} | |
lastEventId: ${lastEventId} | |
source: ${source} | |
ports: ${ports} | |
`); | |
self.addEventListener("message", function(e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Native JS (fast) | |
uniq = function( /* Array */ arr) { | |
var test = {}; | |
var result = []; | |
for (var i = 0, len = arr.length; i < len; i++) { | |
if (!test[arr[i]]) { // value not seen yet? | |
test[arr[i]] = true; | |
result.push(arr[i]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
☼ HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew upgrade v8 | |
==> Upgrading v8 | |
rm /usr/local/bin/v8 | |
rm /usr/local/include/v8stdint.h | |
rm /usr/local/include/v8.h | |
rm /usr/local/include/v8-testing.h | |
rm /usr/local/include/v8-profiler.h | |
rm /usr/local/include/v8-preparser.h | |
rm /usr/local/include/v8-debug.h | |
rm /usr/local/lib/libv8.dylib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :branch do | |
tags = `git tag`.split("\n") | |
list = tags.collect {|x| %(#{tags.index(x)}: #{x}) } | |
puts %(------------------------------------------ | |
Available Tags for Deployment | |
Use m for master | |
------------------------------------------) | |
puts list << "------------------------------------------\n" | |
i = Capistrano::CLI.ui.ask('Tag to deploy:') | |
i == 'm' ? 'master' : tags[i.to_i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some credits: | |
# Code this verions is based on: Andrew Birkett | |
# http://www.nobugs.org/developer/ruby/method_finder.html | |
# Improvements from _why's blog entry | |
# * what? == - _why | |
# * @@blacklist - llasram | |
# * $stdout redirect - _why | |
# http://redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html | |
# Improvements from Nikolas Coukouma | |
# * Varargs and block support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :test do | |
task :populate_testopts do | |
if ENV['TESTNAME'].present? | |
ENV['TESTOPTS'] = ENV['TESTOPTS'] ? "#{ENV['TESTOPTS']} " : '' | |
ENV['TESTOPTS'] += "--name=#{ENV['TESTNAME'].inspect}" | |
end | |
end | |
end | |
%w(test:units test:functionals test:integration).each do |task_name| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Annoying.js - How to be an asshole to your users | |
* | |
* DO NOT EVER, EVER USE THIS. | |
* | |
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com) | |
* Visit https://gist.github.com/767982 for more information and changelogs. | |
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog | |
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
textmate_bundle_path = File.expand_path('~/Library/Application Support/TextMate/Bundles/') | |
Dir.chdir(textmate_bundle_path) | |
bundles = Dir.glob('*.tmbundle') | |
bundles.each do |bundle| | |
Dir.chdir(File.join(textmate_bundle_path, bundle)) | |
puts %( |
NewerOlder