Skip to content

Instantly share code, notes, and snippets.

View nadeesha's full-sized avatar

Nadeesha Cabral nadeesha

View GitHub Profile
@nadeesha
nadeesha / gist:9543408
Created March 14, 2014 07:23
Git submodule ops
# pull latest commits of the submodules (not the ones your parent is pointing to)
git pull --recurse-submodules
# pull all submodules and get the proper commits as pointed by parent
git pull --recurse-submodules && git submodule update
@nadeesha
nadeesha / walkthrough.html
Created June 26, 2014 21:09
hirewire.lk - a walkthough
<h1 id="hirewirelk-a-walkthough">hirewire.lk - a walkthough</h1>
<p>We are in the business of connecting employers and job seekers. We may not be a replacement to a total HR solution or a recruitment management solution.</p>
<p>Rather, we help you sail past the most excruiciating step of the process - acquiring and pre-screening candidates.</p>
<p>This guide is supposed to be a walkthrough for a recruiter to go from 0-60 in our platform within 10 minutes. If you have further questions, we would be happy to help you from hello@hirewire.lk.</p>
<h2 id="campaigns">Campaigns</h2>
@nadeesha
nadeesha / max_produce_of_three.js
Last active August 29, 2015 14:03
Codility Answers in Javascript
// you can use console.log for debugging purposes, i.e.
// console.log('this is a debug message');
function solution(A) {
A.sort(function(a,b) {
if (a < b) {
return 1;
} else if (a > b) {
return -1;
} else {
@nadeesha
nadeesha / gist:ac2a392ec96d3ba2d034
Created September 26, 2014 16:04
ceresi API spec
Check status
GET http://192.168.59.103:8080/api/status
Get all the users' packages
GET http://192.168.59.103:8080/api/v1/npm/packages
Install a package in the app
PUT http://192.168.59.103:8080/api/v1/npm/install/:package
Issue a request to a pakcage
I need to see my #ec2/ec2publicips
recent wso2 blogposts #rss/wso2
jehanr shit sri lankan mothers say #youtube/search
twitter bootstrap with rails #github/search
i'm gonna pop some tags i got $20 in my pocket #twitter/do
@nadeesha
nadeesha / gist:20539ba8eae4cc6ba4d1
Created October 30, 2014 07:00
my sublime packages
"All Autocomplete",
"Bootstrap 3 Snippets"
"BracketHighlighter"
"DocBlockr"
"Dracula Color Scheme"
"GitGutter"
"HTML-CSS-JS Prettify"
"JavaScript Snippets"
"JavaScriptNext - ES6 Syntax"
"JSHint"
@nadeesha
nadeesha / add.js
Last active August 29, 2015 14:14
function (args) {
function addArray(arr) {
if (arr.length === 1) {
return Number(arr[0]);
}
return Number(arr[0]) + addArray(arr.slice(1));
}
this.exec = function (cb) {
@nadeesha
nadeesha / contibutors.js
Last active August 29, 2015 14:14
contibutors.js
'use strict';
var request = new XMLHttpRequest();
request.open('GET', 'https://api.github.com/repos/' + args[0] + '/contributors', true);
request.onreadystatechange = function()
{
if (request.readyState != 4)
return false;
@nadeesha
nadeesha / contributors.json
Last active August 29, 2015 14:14
contributors.json
{
"name": "ghcontribs3",
"endpoints": ["api.github.com"],
"scriptUrl": "https://rawgit.com/ncthis/6fa481eaceaf96ef6394/raw/0d8db4b2c6db266fed87b63d955d2947e2b1f0f2/contibutors.js"
}
@nadeesha
nadeesha / web-server.js
Created September 2, 2013 19:41
Angular Seed's (https://github.com/angular/angular-seed) node web server updated to have: 1. Directory browsing disabled. 2. Serving a default file (index.html) for a directory root. 3. In absence of a index.html, a dir root URL to return a 404.
#!/usr/bin/env node
var util = require('util'),
http = require('http'),
fs = require('fs'),
url = require('url'),
events = require('events');
var DEFAULT_PORT = 8000;
var DEFAULT_FILE = 'index.html'; // default file for the dir root