Skip to content

Instantly share code, notes, and snippets.

@kracekumar
kracekumar / gist:36791f8a01ad33b5b9e5
Created May 15, 2014 08:06
14th may pycon india 2014 irc meetup
[Wed May 14 2014]
*** You have joined channel #pyconindia [19:25]
*** Users on #pyconindia: kracekumar sayan gits1225 n3oo3n_ kirang89_ kaakku
chandankumar techglider_ anuragkr rx100 satyag haseeb_ theskumar Shaan7
Hobbes`
*** #pyconindia modes: +cnt
*** #pyconindia was created on 2012-06-07 13:33:21
*** rx100 (~rradhakri@64.138.135.2) has quit: Read error: Connection reset by
peer [19:27]
@senko
senko / maybe.py
Last active May 2, 2024 18:35
A Pythonic implementation of the Maybe monad
# maybe.py - a Pythonic implementation of the Maybe monad
# Copyright (C) 2014. Senko Rasic <senko.rasic@goodcode.io>
#
# 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:
#
/*!
* jQuery JavaScript Library v2.1.1pre
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
@bzg
bzg / emacs-strip.el
Last active January 2, 2023 21:22
Emacs, naked
;; Prevent the cursor from blinking
(blink-cursor-mode 0)
;; Don't use messages that you don't read
(setq initial-scratch-message "")
(setq inhibit-startup-message t)
;; Don't let Emacs hurt your ears
(setq visible-bell t)
;; You need to set `inhibit-startup-echo-area-message' from the
;; customization interface:
@jvns
jvns / interview-questions.md
Last active May 14, 2024 18:47
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@atmb4u
atmb4u / മലയാളം.py
Last active December 24, 2015 01:59
A quick proof that python unicode works; and it works beautifully! Python 3.x example.
class സൂചിക:
"""
മലയാളത്തിൽ പൈതോണ്‍ കോഡ് ചെയ്യാം എന്നുള്ളതിനുള്ള തെളിവ്
Proof that python can use malayalam language (Only on Python 3x)
"""
def സൂചിക(സ്വയം):
print(u"പൈതോണ്‍ ഇപ്പോൾ മലയാളത്തിലും !")
സൂചി = സൂചിക()
സൂചി.സൂചിക()
@vu3rdd
vu3rdd / papers.markdown
Last active February 13, 2019 06:01
List of Papers for Bangalore PL/CS paper reading group

Context

This tweet explains it all.

I have a huge pile of papers on my computer waiting to be read. Often I read parts of it immediately after I see the paper, but I forget about it until someone points on another article, how awesome that paper is. I then remember to read it more carefully.

One way to fix it is to work with like minded people and have serious (non-hand wavy) discussion around the paper.

The list below will grow. My hard disk has more papers than I can count. I have carefully chosen a list of very readable papers in the list below. Special thanks for the authors for publishing their great ideas.

@willurd
willurd / web-servers.md
Last active May 28, 2024 06:57
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@yuvipanda
yuvipanda / replaceAll.java
Created March 22, 2013 22:06
Replace buggy Matcher.replaceAll in Android with a working version. Does not replace uncaptured group references with 'null'
// Implementation of Matcher.replaceAll differs in Android and JDK
// In JDK, if a group has not been captured, it is replaced with ""
// In android, it is replaced with the string 'null'
// This is annoying. Can't really be fixed without fully encapsulating the class
// So, rewriting replaceAll algorithm
// So we'll just do backref replacement and pass it back to the original replaceAll
private String replaceAll(Matcher matcher, String input, String replacement) {
// Process substitution string to replace group references with groups
int cursor = 0;
StringBuilder result = new StringBuilder();