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
import com.google.common.base.Preconditions; | |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStreamWriter; |
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
'use strict'; | |
require('date-utils'); | |
var underscore = require('underscore'); | |
/** | |
* Constructs a brand new AccessToken | |
* | |
* @param client {OAuth2.Client} The OAuth2 client that will be used for |
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
'use strict'; | |
/** | |
* Block class is used for routing errors to higher level logic. | |
*/ | |
function Block(errback) { | |
this._parent = Block.current; | |
this._errback = errback; | |
} | |
Block.current = null; |
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
class EnableUuid < ActiveRecord::Migration | |
def change | |
enable_extension 'uuid-ossp' | |
end | |
end |
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
// ############################################################################# | |
// Configurations | |
// ############################################################################# | |
group = 'com.someapp' | |
version = '1.0.0' | |
mainClassName = "${group}.Launcher" | |
description = "Some description" | |
buildDir = 'build/' | |
// ############################################################################# |
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
package net.warmwaffles.utils.concurrent; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.locks.Condition; | |
import java.util.concurrent.locks.ReentrantLock; | |
/** | |
* A light wrapper around the {@link ThreadPoolExecutor}. It allows for you to pause execution and |
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
#!/bin/sh | |
# title : yaourt-install | |
# description: This script install yaourt downloading and compiling package-query and yaourt | |
# author : Christopher Fernández | |
# usage : yaourt-install | |
echo "================================================" | |
echo "Remember that you need to be in the sudoers file" | |
echo "to install Yaourt successfully." | |
echo "================================================" |
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
Vagrant.configure('2') do |config| | |
config.vm.box = 'arch64' # http://vagrant.srijn.net/archlinux-x64-2014-01-07.box | |
config.vm.synced_folder('srv/', '/srv/') | |
inline = [ | |
'pacman -Syu --noconfirm' | |
].join(';') | |
config.vm.provision(:shell, inline: inline) | |
config.vm.provision(:salt) do |salt| |
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
#!/bin/bash | |
PORT=$1 | |
${PORT:=8000} | |
python -m SimpleHTTPServer $PORT |
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
require 'benchmark' | |
max = (ARGV.shift || 10_000_000).to_i | |
puts "# of iterations = #{max}" | |
Benchmark::bm(20) do |x| | |
x.report("each") do | |
(0..max).each do | |
end | |
end |