Skip to content

Instantly share code, notes, and snippets.

View advait's full-sized avatar
👋
Sumimasen

Advait Shinde advait

👋
Sumimasen
View GitHub Profile
@advait
advait / rowcol.js
Created February 4, 2012 14:23
Row/column fetching!
/**
* Gets font size information about the athens editor and stores it in
* hhwm.athens.
*/
hhwm.reloadAthens = function() {
// Get top and left offset
var athens = $('#athens');
hhwm.athens.topBorder = parseInt(athens.css('border-top-width').replace('px', ''));
hhwm.athens.topPadding = parseInt(athens.css('padding-top').replace('px', ''));
tons_of_words = ['Electricity', 'Shop', 'Room', 'Bird', 'Videotape', 'Adult', 'Gloves', 'Bridge', 'Post-office', 'Freeway', 'Fruit', 'Film', 'Ice', 'Sandwich', 'Sun', 'Television', 'Fan', 'Spectrum', 'Drink', 'Festival', 'Church', 'Pocket', 'Explosive', 'God', 'Man', 'Torch', 'Spoon', 'Air', 'Bed', 'Clown', 'Bathroom', 'Hammer', 'Bomb', 'Circle', 'Coffee', 'Bathtub', 'Sandpaper', 'Circus', 'Typewriter', 'Church', 'Dress', 'Window', 'Bed', 'Treadmill', 'Ears', 'Mouth', 'Egg', 'Rifle', 'Data Base', 'Tiger', 'Apple', 'Drill', 'Hat', 'Carpet', 'Sphere', 'Needle', 'Airforce', 'Train', 'Guitar', 'Fire', 'Diamond', 'Pants', 'Ring', 'Microscope', 'Arm', 'Saddle', 'Swimming Pool', 'Banana', 'Meteor', 'Staircase', 'Bible', 'Magnet', 'School', 'Airport', 'Maze', 'Umbrella', 'Alphabet', 'Sports-car', 'Satellite', 'Junk', 'Carrot', 'Woman', 'Pyramid', 'Girl', 'Clock', 'Vampire', 'Thermometer', 'Button', 'Shower', 'Chess Board', 'Prison', 'Necklace', 'Signature', 'Highway', 'Record', 'Radar', 'Eyes', 'Bowl', 'Elephant', 'R
@advait
advait / icp-hw2-solutions.py
Created May 16, 2012 09:29
Solutions to ICP1 Homework 2
"""
Introdcution to Computer Programming 1
Homework 2 Solutions
Advait Shinde
Note: I tried to keep my solutions well documented. Notice the
triple quote documentation in each function body. This is pretty standard
in the Python world - a great way to show what your implementation does
and how somebody else can use it!
"""
@advait
advait / backoff.js
Created August 21, 2014 19:44
Fibonacci backoff for promises. Retries a function indefinitely until it succeeds (Promise resolves).
/**
* Given a function promiseFunctionToRetry that returns a Promise, repeatedly
* call the function with a fibonacci backoff until it results in a resolved
* Promise.
* @param {function} promiseFunctionToRetry a function that returns a Promise
* that can potentially reject. This may be called multiple times.
* @param {number?} backoff An optional starting backoff in ms (default 1000)
* @return {Promise} guaranteed to never reject
*/
var backoff = function(promiseFunctionToRetry, backoff) {

Keybase proof

I hereby claim:

  • I am advait on github.
  • I am advait (https://keybase.io/advait) on keybase.
  • I have a public key ASAmbCDAtCy22GL9NvZrreQvEfBqQyIRGEF9dcyj2UO3GQo

To claim this, I am signing this object:

@advait
advait / brain.fm.spacebar.play.pause.user.js
Created August 15, 2017 20:25
Userscript for brain.fm: Press spacebar to play or pause
// ==UserScript==
// @name Brain.fm (play/pause spacebar)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Press spacebar to play/pause brain.fm
// @author advait
// @match https://www.brain.fm/app*
// @grant
// @run-at document-end
// ==/UserScript==
//var bkg = chrome.extension.getBackgroundPage();
var calls = {};
// Shows settings on install.
chrome.runtime.onInstalled.addListener(function(details) {
if(details.reason && (details.reason === 'install') || (details.reason === 'update')){
chrome.tabs.create({url: "options.html"});
}
});
// Show settings when clicking on the icon.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDnW2XHqOk4vGhbt7Jk86W7ExEX+GAJSB1CfhX+RTHe9ojSxkgqx16Bt+VAxVp1ZxSzNtgkFoU4NWyZVSfb2VCLmXSKwtLtoYAwDS+2WhZN8wTQ8s87rhjfU8fK/ilTPF8dDH8hqBHMNoGeXn+mKswc8a/jOwqzHRlscIayHXTVq32KCmAqZEBJ6mv9H9Qsjg0FOzVw9qcOKzRrG+u0JuDJlZGdM8gDRvGLGT4neq642IAXcGWK6yLoDIRIBgsQh6QM3FFetTrHOBfBH0pHTFvee8oQ1OOtzoTmQfO+mPzTgcCexmpmdgPlp5Qbe1uOFZbfpvqyp4SxsBlnHDL8fjBv advait@AANG-WIN
@advait
advait / spec.json
Created February 20, 2024 21:56
skill2
{
"config": {"view": {"continuousWidth": 300, "continuousHeight": 300}},
"data": {"name": "/@file/24141-67254-axkh6O9k.csv"},
"mark": {"type": "circle", "size": 60, "cursor": "pointer", "tooltip": true},
"encoding": {
"color": {
"field": "cluster",
"scale": {"scheme": "category10"},
"type": "nominal"
},