Skip to content

Instantly share code, notes, and snippets.

@aslakhellesoy
aslakhellesoy / Makefile
Last active August 29, 2015 13:56
How to concatenate and minify js with make
BIN = node_modules/.bin
# Combine, ngmin and minify all of our own scripts
public/app.js: \
ng-app/providers/providers.js \
ng-app/providers/*.js \
ng-app/cucumber_pro.js \
ng-app/**/*.js
ifdef DEBUG
@aslakhellesoy
aslakhellesoy / gist:9321274
Created March 3, 2014 09:15
Limechat defaults
defaults read net.limechat.LimeChat "main_window"
{
h = 713;
info = 250;
log = 150;
root = 0;
"spell_checking" = 1;
tree = 120;
w = 1025;
x = 141;
package lambdas;
import sun.reflect.ConstantPool;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
public class TypeTest {
@FunctionalInterface
@aslakhellesoy
aslakhellesoy / drop_collections.js
Created September 17, 2014 17:30
Some code I use in tests to drop collections between tests.
var async = require('async');
var collections = ['projects', 'users', 'drafts', 'share_docs', 'share_docs_ops'];
module.exports = function(db, cb) {
function dropCollection(name, cb) {
db.collection(name, function(err, collection) {
if(err) return cb(err);
collection.drop(cb);
});
}
@aslakhellesoy
aslakhellesoy / README.md
Last active August 29, 2015 14:07
VMWare Fusion 7 borked

Every time I start VMWare Fusion 7.0 I get this:

VMWare error

I have tried to drag the VMWare app in the trash and manually remove a lot of files and then reinstall.

But the dialog keeps coming back.

I'm on OS X 10.9.4.

// Translates a Google diff-match-patch diff to an array of ottypes textv1 ops
// Pretty straight-forward!
module.exports = function (diff) {
var ops = [];
for(var i = 0; i < diff.length; i++) {
var diffComp = diff[i];
switch(diffComp[0]) {
case -1: // DELETION
ops.push({d:diffComp[1].length});
break;
@main
Feature: Totals
Scenario: Create Total
@teams
Scenario: Create Team Total
# This script sets up (or removes) port forwarding on VirtualBox
# for all ports defined in fig.yml
require 'yaml'
op = ARGV[0]
if op.nil? || !( /(up|down)/ =~ op )
$stderr.puts "Usage:\n ruby #{__FILE__} up|down"
exit 1
end
Feature: Create Healthcare Study Team user account
The back-office users should be able to create a Healthcare
Study Team user account.
Rules:
- The following fields are mandatory:
- Gender (male, female)
- Last Name
- First Name
describe "Given logged in, Homepage: url(:home)" do
before(:each) do
@rack = request(:home)
login
end
it "allows the user to visit" do
@rack.should be_successful
@rack.body.should == "Welcome"
end