Skip to content

Instantly share code, notes, and snippets.

View sadikkuzu's full-sized avatar

SADIK KUZU sadikkuzu

View GitHub Profile
@MrPeker
MrPeker / consoleLog.js
Last active November 9, 2019 22:09
Customize your console log output for don't ask "this output from which line?"
let log = console.log;
console.log = function() {
log("");
log.apply(console, arguments);
let info = new Error().stack.split(' at ')[2].trim().split(__dirname);
log('-- from', '\x1b[33m', info[0].split(' (')[0], '\x1b[0m', 'at', '\x1b[33m', info[1], '\x1b[0m');
};
@rxaviers
rxaviers / gist:7360908
Last active April 26, 2024 06:50
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@econchick
econchick / gist:4666413
Last active December 22, 2023 13:32
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
@hemanth
hemanth / fast.md
Created September 13, 2012 16:19
Guido van Rossum's Tips for fast Python

Guido van Rossum11 Sep 2012 - Public

Some patterns for fast Python. Know any others?

  • Avoid overengineering datastructures. Tuples are better than objects (try namedtuple too though). Prefer simple fields over getter/setter functions.

  • Built-in datatypes are your friends. Use more numbers, strings, tuples, lists, sets, dicts. Also check out the collections library, esp. deque.

  • Be suspicious of function/method calls; creating a stack frame is expensive.

@esamattis
esamattis / .pdbrc
Created August 4, 2011 12:18
What every python developer should have in their ~/.pdbrc
# Enable tab completion
import rlcompleter
import pdb
pdb.Pdb.complete = rlcompleter.Completer(locals()).complete
# Sometimes when you do something funky, you may lose your terminal echo. This
# should restore it when spanwning new pdb.
import termios, sys
termios_fd = sys.stdin.fileno()
termios_echo = termios.tcgetattr(termios_fd)