Skip to content

Instantly share code, notes, and snippets.

View shurane's full-sized avatar

Ehtesh Choudhury shurane

  • Astoria, NY | Seattle, WA
  • 23:36 (UTC -07:00)
View GitHub Profile
@shurane
shurane / flatten-dictionary.markdown
Created August 15, 2016 20:05
interview problems

##Flatten a Dictionary

Given a dictionary, write a function to flatten it. Consider the following input/output scenario for better understanding:

Input:

{
  'Key1': '1',
  'Key2': {

'a' : '2',

@shurane
shurane / app.component.ts
Created July 12, 2016 21:29
angular 2 tutorial troubles - part 5 - routing
import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';
import { HeroService } from './hero.service';
@Component({
selector: 'my-app',
template: `
<h1>{{title}}</h1>
<a [routerLink]="['/heroes']">Heroes</a>
<router-outlet></router-outlet>
`,
@shurane
shurane / shell.session
Created May 30, 2016 17:47
valgrind uninitialized values
$ clang++ -Wall --std=c++11 uninitialized.cpp -o main
$ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./main
==17245== Memcheck, a memory error detector
==17245== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==17245== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==17245== Command: ./main
==17245==
==17245== Conditional jump or move depends on uninitialised value(s)
==17245== at 0x4EBFCDE: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19)
@shurane
shurane / elevator.py
Created January 30, 2016 03:22
Ken Elevator Interview
events:
- floorReached, {floor=2}
- buttonPressedInside, {floor=1}
- buttonPressedOutside, {floor=3,
direction=UP|DOWN}
def moveUp()
def moveDown()
@shurane
shurane / put.io.speedtest.txt
Created January 26, 2016 15:28
2016/01/26 speed test
Default (Netherlands) 510 KB/s
Australia (Melbourne) 288 KB/s
Australia (Sydney) 290 KB/s
Brazil (São Paulo) 385 KB/s
Canada (Beauharnois, Montreal) 1436 KB/s
Canada (Toronto, Ontario) 1039 KB/s
China (Hong Kong) 293 KB/s
Czech Republic (Prague) 737 KB/s
France (Paris) 292 KB/s
France (Roubaix) 731 KB/s
This file has been truncated, but you can view the full file.
10
100000
575 426 445 772 81 447 629 497 202 775 325 982 784 417 156 932 902 728 537 857 739 918 211 679 506 340 568 868 16 940 263 593 449 991 310 355 68 431 580 757 218 934 328 676 355 221 80 922 545 511 67 467 674 691 504 835 34 965 980 221 895 501 152 325 731 302 153 896 22 489 399 607 466 432 502 968 333 475 792 84 10 694 328 354 712 409 480 643 121 951 492 420 197 607 925 167 717 438 200 986 104 483 620 806 881 858 559 553 502 554 962 325 435 279 464 327 549 832 595 200 720 658 639 992 130 467 989 958 581 600 466 473 929 775 581 770 455 718 628 807 335 898 552 530 811 569 148 384 954 913 114 315 686 334 382 392 326 8 553 962 957 850 231 61 185 588 305 980 564 890 52 747 943 740 593 469 370 516 443 7 525 299 412 163 699 571 976 455 217 590 343 427 220 342 584 239 496 875 601 258 449 377 40 428 238 455 517 653 433 768 957 307 456 878 977 368 999 882 541 826 764 269 401 98 698 763 515 413 495 523 571 206 357 904 310 410 844 611 484 410 559 262 394 949 107 546 737 987 979 306 685 291 542 542 134 94 751 89 8
context: qawwali showdown between two women arrayed in traditional attire, one in a white-skirted outfit and one in a blue-skirted one, each with her respective posse
White Skirt: *vocalization in traditional qawwali style*
Master [term of respect for expert teachers] Zuckerberg
when he invented Facebook
White Skirt's Drummer: Goodbye, Orkut
White Skirt: there was one thing
he forgot to mention
@shurane
shurane / LICENSE
Last active September 11, 2015 18:13
angularjs lesson plan
The MIT License (MIT)
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@shurane
shurane / jordan-1.nlogo
Created September 7, 2015 03:29
Jordan Smith's progress -- Programming in NetLogo
@shurane
shurane / formatting.js
Last active September 5, 2015 02:02
saves page offset on long HTML pages. Good for reading articles or e-books.
// so useful for formatting a webpage to X pixels wide and centered. So useful!
document.body.style.maxWidth = "600px"
document.body.style.margin = "0 auto";