Skip to content

Instantly share code, notes, and snippets.

View Pooshan's full-sized avatar
🎯
Focused and not finished

Pooshan Vyas Pooshan

🎯
Focused and not finished
  • Apple, Cisco, Chartboost, Marin Software, Sonikpass, Gigamon
  • San Francisco, California, United States
  • X @pooshanv
View GitHub Profile
@Pooshan
Pooshan / beautiful_idiomatic_python.md
Created March 11, 2017 18:47 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@Pooshan
Pooshan / 0_reuse_code.js
Created March 2, 2017 06:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Pooshan
Pooshan / cover-letter.md
Created October 22, 2016 21:31 — forked from jcoglan/cover-letter.md
How to write a cover letter

Dear XCorp / Hi, XCorp depending on familiarity

I'm writing in response to X, where you advertised a vacancy for Y. I am interested in applying for this role -- please find my CV attached.

My current employment position is X, which means I'm responsible for delivering/organising/producing A, B, and C. I was previously the Y at Z where I did D. My main responsibility / largest project here has been P, which is a Widget that produces Doo-dads.

While I enjoy working at X for reasons K and L, I find M frustrating. I'm also looking to move on into areas such as N, P and Q, without losing touch with K. I find K valuable but I would prefer to change my working environment to include P.

I'm particularly interested in XCorp because, as well as providing the career experience I'm after, I use your product / admire your work / look up to your staff for these reasons: ...

// bank.java
// demonstrate basic OOP syntax
Class BankAccount
{
//account balance
private double balance;
//Constructor — Initializing constructor is very important
public BankAccount(double openingBalance);
{
balance = openingBalance;
@Pooshan
Pooshan / xor.py
Created December 2, 2015 19:10 — forked from revolunet/xor.py
Simple python XOR encrypt/decrypt
#
# NB : this is not secure
# from http://code.activestate.com/recipes/266586-simple-xor-keyword-encryption/
# added base64 encoding for simple querystring :)
#
def xor_crypt_string(data, key='awesomepassword', encode=False, decode=False):
from itertools import izip, cycle
import base64
if decode:
@Pooshan
Pooshan / socket.c
Last active August 29, 2015 14:16 — forked from nolim1t/socket.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
@Pooshan
Pooshan / socket.c
Last active August 29, 2015 14:16 — forked from nolim1t/socket.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>