Skip to content

Instantly share code, notes, and snippets.

@azharkhan
azharkhan / fuel.py
Last active December 11, 2019 05:28
Advent of Code 2019 - 1
with open("fuel.txt", "r") as f:
lines = [int(line) for line in f.readlines()]
def add(x, y): return x + y
def calc(x):
if (x // 3 - 2 <= 0):
return 0
else:
return x // 3 - 2 + calc(x // 3 - 2)
@azharkhan
azharkhan / error.json
Created February 25, 2019 22:03
error json
{"errors":{"businessMeta.shipsFrom.geometry.bounds.northeast.lat":{"message":"Cannot read property 'locationType' of undefined","name":"ValidatorError","properties":{"message":"Cannot read property 'locationType' of undefined","type":"user defined","path":"geometry.bounds.northeast.lat","value":71.5388001,"reason":{}},"kind":"user defined","path":"geometry.bounds.northeast.lat","value":71.5388001,"reason":{},"$isValidatorError":true},"businessMeta.shipsFrom.geometry.bounds.northeast.lng":{"message":"Cannot read property 'locationType' of undefined","name":"ValidatorError","properties":{"message":"Cannot read property 'locationType' of undefined","type":"user defined","path":"geometry.bounds.northeast.lng","value":-66.88541700000002,"reason":{}},"kind":"user defined","path":"geometry.bounds.northeast.lng","value":-66.88541700000002,"reason":{},"$isValidatorError":true},"businessMeta.shipsFrom.geometry.bounds.southwest.lat":{"message":"Cannot read property 'locationType' of undefined","name":"ValidatorError","p
@azharkhan
azharkhan / framework-for-the-framework.md
Created November 8, 2017 20:04
Notes from Framework Meeting

Problems

  • attracting talent
  • hard to debug
  • no good developer tools
  • template is very hard to debug
  • framework is very verbose, lots of coupling
  • harder to separate concerns
  • growth of knowledge via conferences and talks - risk of stagnant
  • future support
@azharkhan
azharkhan / script.babel
Created May 11, 2017 19:19
Testing `getTitle`
const user = {
t: '',
companyName: 'SkyNet'
};
let result = [user.t, user.companyName].filter(function(item) {
return !_.isNil(item);
}).join(' at ');
console.log(result);
@azharkhan
azharkhan / fav-comics.md
Last active March 28, 2017 21:47
List of Favourite Comics

List of Comics

Image Comics

  1. Saga
  2. The Wicked and the Divine
  3. Southern Bastards
  4. Sex Criminals
  5. Tokyo Ghost
  6. East of West
Verifying I am +azhar on my passcard. https://onename.com/azhar
@azharkhan
azharkhan / randomNum.js
Created March 26, 2015 23:48
Random Number Generator
/**
* Returns a random number between min and max
*/
function getRandomArbitary (min, max) {
return Math.random() * (max - min) + min;
}
/**
* Returns a random integer between min and max
* Using Math.round() will give you a non-uniform distribution!
@azharkhan
azharkhan / keybase.md
Last active August 29, 2015 14:14
Keybase Verification

Keybase proof

I hereby claim:

  • I am azharkhan on github.
  • I am azhar (https://keybase.io/azhar) on keybase.
  • I have a public key whose fingerprint is 17C4 A389 7E7D 20B2 651A 9554 22B1 CC87 6D6B BB74

To claim this, I am signing this object:

@azharkhan
azharkhan / search string in shell
Created August 21, 2013 19:46
Find all occurrences of String in Folder and recursively search Sub-Folders
grep -nr yourString* .