Skip to content

Instantly share code, notes, and snippets.

View vinitkumar's full-sized avatar
🪀
Focusing

Vinit Kumar vinitkumar

🪀
Focusing
View GitHub Profile
@vinitkumar
vinitkumar / x.md
Created January 4, 2013 14:48 — forked from Raynos/x.md

DOM Libraries, the easy way

  • [by. Select elements][1]
  • [fragment. Turn HTML into DOMFragments][2]
  • [class-list. Cross browser HTML5 classList implementation][3]
  • [dom-walk. Traverse the DOM in tree order][4]
  • [xhr. Minimal cross browser, cross domain XHR][5]
  • [insert. Cross browser DOM4 insertion methods][6]
  • [to-array. Convert nodelists into arrays][7]
  • [hidden. Cross browser HTML5 hidden property][8]
// Render view helper
// if the request is coming from mobile and if you have a view
// with users.mobile.jade, then that view will be rendered
app.use(function (req, res, next) {
res._render = res.render
res.render = function (template, locals, cb) {
var ua = req.header('user-agent')
var fs = require('fs')

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

$(function() {
// good opportunity to combine into a single statement
// qq w cw <esc> A, <esc> 0 j q
var a = 10;
var b = 20;
var c = 30;
var d = 40;
var e = 50;
// opportunity to simplify syntax
@vinitkumar
vinitkumar / The Technical Interview Cheat Sheet.md
Last active January 18, 2016 19:25 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@vinitkumar
vinitkumar / cmd.sh
Last active September 11, 2015 12:37 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@vinitkumar
vinitkumar / .slate.js
Created November 30, 2015 09:07 — forked from leb2/.slate.js
My Slate Config
var MARGIN = 28;
// Fullscreen
slate.bind('f:cmd,alt', function(win) {
// ±4 to account for hidden Dock on left of screen.
win.doOperation(S.op('move', {
'x': 'screenOriginX - 4 + ' + MARGIN,
'y': 'screenOriginY + ' + MARGIN,
@vinitkumar
vinitkumar / bst.js
Created June 24, 2016 11:50 — forked from trevmex/bst.js
A simple binary search tree in JavaScript
/*
* File: bst.js
*
* A pure JavaScript implementation of a binary search tree.
*
*/
/*
* Class: BST
*

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets