Skip to content

Instantly share code, notes, and snippets.

View apnerve's full-sized avatar
🏠
Working from home

Praveen apnerve

🏠
Working from home
View GitHub Profile
@apnerve
apnerve / insta-download.js
Last active May 26, 2017 19:22
Bookmarklet script to download images from Instagram
javascript:(function() {Array.prototype.map.call(document.querySelectorAll('._icyx7'),function(a){return a.attributes[3].nodeValue.replace('s640x640/sh0.08/','')}).map(function(i){var l = document.createElement('a');l.href=i;l.download=i;document.body.appendChild(l);l.click()});})()
@apnerve
apnerve / credit-cart.js
Created September 12, 2015 17:03
Where am I spending my money?
var fs = require('fs');
var sc = require('sc-card-transaction-parser');
var _ = require('lodash');
var file = fs.readFileSync('transactions.txt');
var transactions = sc.parseLog(file);
var expenses = function(data, type) {
var grouped = _.groupBy(data, type);
return _.keys(grouped).map(function(a) {
return {
@apnerve
apnerve / options.md
Last active September 14, 2016 13:51
Basic UX guidelines on when to choose radio buttons or select or an autocomplete component

When the no. of items are less than 5, it is advisable to use radio When the no. of items are greater than 5, select is better When the no. of items is more than 15, select makes no sence and having a simple text with autocomplete or something similar to chosen is more suitable.

@apnerve
apnerve / The Technical Interview Cheat Sheet.md
Created March 22, 2017 20:30 — 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.
@apnerve
apnerve / twitter verified account
Created May 24, 2017 19:11
Not a verified account? No problem, this bookmarklet will add the verified icon (which is completely pointless but fun as it reminds me of Orkut days)
javascript:(function(){$('.ProfileHeaderCard-name').append('<span class="ProfileHeaderCard-badges"><a href="/help/verified" class="js-tooltip" target="_blank" title="Verified account" data-placement="right" rel="noopener"><span class="Icon Icon--verified"><span class="u-hiddenVisually">Verified account</span></span></a></span>');$('.ProfileHeaderCard-badges').css({left: '-6px'});$('.my-tweet .FullNameGroup .UserBadges').append('<span class="Icon Icon--verified"><span class="u-hiddenVisually">Verified account</span></span>')})()
@apnerve
apnerve / carnatic_music_theory.md
Created August 9, 2017 09:10
Carnatic Music Theory

Music theory

Notes Hindustani Carnatic Western
I IIb IIIb IV# V VIb VII Todi Shubhapantuvarali Chromatic lydian inverse
I II IV V VII / VIIb VI V IV III II I Desh NA NA, Mixolydian while coming down
@apnerve
apnerve / whiteframr.url
Created November 1, 2018 10:01
A simple bookmarklet to convert any website to a whiteframe
javascript:(function() {[].slice.apply(document.all).forEach(e => { e.style.color = 'black'; e.style.background = 'none'; e.style.borderColor = 'black';e.style.boxShadow = 'none'} );[].slice.apply(document.querySelectorAll('img')).forEach(i => {i.style.backgroundColor='lightgray';i.width = i.width; i.height = i.height;i.alt='';i.style.filter='none';i.style.border='none';i.src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'})})()
setTimeout(function() {
function getAllModules() {
return new Promise((resolve) => {
const id = _.uniqueId("fakeModule_");
window["webpackJsonp"](
[],
{
[id]: function(module, exports, __webpack_require__) {
resolve(__webpack_require__.c);
}
@apnerve
apnerve / gist:c8db4e15cf32af07396b87ddc46e1aee
Created December 11, 2018 07:29
Election results bookmarklet
javascript:window.results = ([].slice.apply(document.querySelectorAll('#div1 tr'))).slice(3,-1).map(row => {const cells = row.querySelectorAll('td');return {c:cells[0].innerText,p: cells[1].innerText,v:Number(cells[2].innerText)}})
@apnerve
apnerve / gist:720bf7b34121318f343e667dc00557d5
Created January 22, 2019 16:42
Useful docker utilities
docker run --rm -v $(pwd):/app composer:latest install --no-dev