Skip to content

Instantly share code, notes, and snippets.

View krrishd's full-sized avatar
🤯

Krish Dholakiya krrishd

🤯
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@nstadigs
nstadigs / asyncLs
Last active October 8, 2015 08:28
localStorage ORM
(function(exports) {
var mod = function (databaseName, saveInterval) {
var self;
saveInterval = saveInterval || 2000;
databaseName = databaseName || 'unnamed';
this.hasChanged = false;
this.store = {};
@krrishd
krrishd / backtogeocities.js
Last active April 19, 2016 19:43
Bootstrap To Geocities
/*
Tired of the same old bootstrapped site?
Miss the trendy, hip Geocities look?
This bookmarklet will fix that in a click!
Derived from Bootstrap Geocities theme at http://code.divshot.com/geo-bootstrap/
Simply add new bookmark, edit url, and add bottom code in place of url. Whenevver you miss Geocities, click it.
*/
@thijsdezoete
thijsdezoete / backtogeocities.js
Last active December 25, 2015 18:29 — forked from krrishd/backtogeocities.js
Support other protocols as well..
/*
Tired of the same old bootstrapped site?
Miss the trendy, hip Geocities look?
This bookmarklet will fix that in a click!
Derived from Bootstrap Geocities theme at http://code.divshot.com/geo-bootstrap/
Simply add new bookmark, edit url, and add bottom code in place of url. Whenevver you miss Geocities, click it.
*/
@srikarg
srikarg / gulpfile.js
Last active August 29, 2015 13:59
A boilerplate gulpfile (http://gulpjs.com/). Features live reloading of SASS, CoffeeScript, and HTML.
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
plugins.connect = require('gulp-connect');
plugins.jshint = require('gulp-jshint');
var port = 4000;
gulp.task('styles', function() {
return plugins.rubySass('sass/main.scss', { style: 'compressed' })
.pipe(plugins.autoprefixer('last 15 version'))
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active June 12, 2024 03:08
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.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@krrishd
krrishd / rss2json.js
Last active November 24, 2017 08:56
rss2json
/*
* Example Usage:
*
* $.get('http://cors.io/sprunge.us/ILRc', function(data) {
* window.xmlData = data;
* window.domParser = new DOMParser();
* window.parsedXML = domParser.parseFromString(window.xmlData, 'text/xml');
* window.jsonFeed = rss2json(parsedXML);
* });
*
@krrishd
krrishd / get.js
Last active August 29, 2015 14:04
For when I don't want to use jQuery or Angular to make GET HTTP requests, neither do I care for raw XHR.
/*
* By Krish Dholakiya (itskrish.co, git.io/krish)
* MIT Licensed.
*
* GET('http://example.com/index.html', 'html') => returns DOM object
* GET('http://example.com/api.json', 'json') => returns parsed JSON object
*
* TODO: add more types (XML, etc)
* CDN url: https://cdn.rawgit.com/krrishd/f17247fcd6ff2335ca5f/raw//b5c2f93d8d3246dabe07cf9b6e73d71631f907b2
*/
@krrishd
krrishd / http.js
Last active August 29, 2015 14:04
Simple XHR stuff. Probably already done in a neater way, but I was just experimenting and wanted simplicity of the highest degree. Essentially it's a combo of my post.js and get.js
/*
* By Krish Dholakiya (itskrish.co, git.io/krish)
* MIT Licensed.
*
* GET('http://example.com/index.html', function(response) {
* var responseFromServer = response;
* });
* POST('http://example.com', {'keyOne': 'valueOne', 'keyTwo': 'valueTwo'}, function(response) {
* var responseFromServer = response;
* });
@mlynch
mlynch / Undo.md
Last active April 9, 2024 11:28
Undo/Redo

Undo/Redo

Undo/Redo is one of those features of an application that you almost always need to have if you are building serious GUI tools for people to do work.

The best way to look at undo/redo is two stacks of operations the user has performed:

  • The Undo stack is the "history" of what they've done
  • The redo stack is the breadcrumbs back to the initial state before they started undoing