Skip to content

Instantly share code, notes, and snippets.

@azharkhan
azharkhan / fuel.py
Last active Dec 11, 2019
Advent of Code 2019 - 1
View fuel.py
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)
View 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
View framework-for-the-framework.md

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
Testing `getTitle`
View script.babel
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 Mar 28, 2017
List of Favourite Comics
View fav-comics.md

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
View gist:68606f51a94b2b7b083d
Verifying I am +azhar on my passcard. https://onename.com/azhar
@azharkhan
azharkhan / randomNum.js
Created Mar 26, 2015
Random Number Generator
View randomNum.js
/**
* 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 Aug 29, 2015
Keybase Verification
View keybase.md

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 Aug 21, 2013
Find all occurrences of String in Folder and recursively search Sub-Folders
View search string in shell
grep -nr yourString* .