Skip to content

Instantly share code, notes, and snippets.

View samarpanda's full-sized avatar
👋

Samar Panda samarpanda

👋
View GitHub Profile
@samarpanda
samarpanda / Load_test.md
Created July 30, 2015 01:21
Siege for load test of http applications

Concept of Selection Sort

  1. Find minimum index of array starting from given index
  2. Swap values of array
  3. Loop through array elements: Find minimum value index and swap
@samarpanda
samarpanda / testHook.js
Created August 15, 2015 15:17
My first hook.io microservice
// A simple hello world microservice
// Click "Deploy Service" to deploy this code
// Service will respond to HTTP requests with a string
module['exports'] = function helloWorld (hook) {
// hook.req is a Node.js http.IncomingMessage
var host = hook.req.host;
// hook.res is a Node.js httpServer.ServerResponse
// Respond to the request with a simple string
hook.res.end(host + ' says, "Hello world!"');
};

Command line pro tips

!! # run the last command executed
sudo !! # run the last command as root
!<word> # run last command starting with a specific word
!<word>:p # ^ list, but don't run that last command
<space>command # execute a command w/out saving in history
echo "ls -l" | at midnight # execute command at given time
caffeinate -u -t 3600 # stop your mac from sleeping for 1hr
@samarpanda
samarpanda / app.js
Last active August 29, 2015 14:28 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@samarpanda
samarpanda / Butt-on-todo-list.md
Last active August 29, 2015 09:11
Butt-on todo list

User

  1. Create User (SignUp)
  2. Login
  3. User details
  4. Button List
  5. Create / Update Button (Manage Button)
  6. Create Order
  7. Manage orders
  8. Order List

Kill Chrome tabs

ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill
@samarpanda
samarpanda / example-subtree-usage.md
Last active September 2, 2015 14:54 — forked from kvnsmth/example-subtree-usage.md
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.