Skip to content

Instantly share code, notes, and snippets.

View nalindak's full-sized avatar

Nalinda Karunaratna nalindak

View GitHub Profile
@nalindak
nalindak / test.js
Created March 2, 2016 12:48 — forked from thanpolas/test.js
Testing promises with mocha
var assert = require('chai').assert;
var when = require('when');
var def1 = when.defer();
function getProm() {
return def1.promise;
}
@nalindak
nalindak / LICENSE
Created March 1, 2016 12:50 — forked from ifraixedes/LICENSE
AWS lambda handler which download images from S3, resizes them and upload the new ones to S3; tested with mocha, chai, sinon and proxyquire
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
(http://www.wtfpl.net/about/)
Copyright (C) 2015 Mario Mendes (@hyprstack)
Copyright (C) 2015 Ivan Fraixedes (https://ivan.fraixed.es)
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@nalindak
nalindak / function.js
Created February 12, 2016 04:45 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
@nalindak
nalindak / iterm2-solarized.md
Created January 28, 2016 07:06 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@nalindak
nalindak / 00-README.md
Created January 28, 2016 04:19
Popeye VM setup

This is a quick script to setup a Popeye development environment.

On a fresh popeye VM,

  1. Set up a shared folder between your computer and the virtual machine. Place your config files in there.
  2. In your documents folder, create a popeye folder for working on this project
  3. Copy the config files from /mnt/media/ to ~/Documents/popeye
  4. Open terminal
cd ~/Documents/popeye
var http = require("http");
var net = require("net");
var installErrorHandling = function(agent) {
agent.createConnection = function(options) {
var socket = net.createConnection(options);
socket.on("error", function(error) {
console.log("GOT ERROR", error, "request options:", options);
});
return socket;
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation