Skip to content

Instantly share code, notes, and snippets.

View Melchizedek13's full-sized avatar

Nikolay Sokolov Melchizedek13

View GitHub Profile
@samuell
samuell / luigi_time_tasks_example.py
Last active June 14, 2022 19:32
How to output the execution time of tasks in the luigi workflow system, as discussed [here](https://groups.google.com/d/msg/luigi-user/uivbf-luX9w/z0GCKKsIefoJ)
import luigi
import time
class TimeTaskMixin(object):
'''
A mixin that when added to a luigi task, will print out
the tasks execution time to standard out, when the task is
finished
'''
@luigi.Task.event_handler(luigi.Event.PROCESSING_TIME)
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 23, 2024 23:26
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mbbx6spp
mbbx6spp / -etc-sysctl
Created July 21, 2012 01:33
Ephemeral port range on OS X
net.inet.ip.portrange.first=32768
net.inet.ip.portrange.hifirst=32768
net.inet.tcp.msl=1000
# for postgresql
kern.sysv.shmall=65536
kern.sysv.shmmax=16777216
# defaults
net.inet.ip.portrange.lowfirst=1023
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@while0pass
while0pass / listchars.vim
Last active April 22, 2024 05:59
show/hide hidden characters in Vim
" hide hidden chars
:set nolist
" show hidden characters in Vim
:set list
" settings for hidden chars
" what particular chars they are displayed with
:set lcs=tab:▒░,trail:▓,nbsp:░
" or
@endolith
endolith / gcd_and_lcm.py
Last active June 22, 2022 23:33
GCD and LCM functions in Python for several numbers
# Greatest common divisor of 1 or more numbers.
from functools import reduce
def gcd(*numbers):
"""
Return the greatest common divisor of 1 or more integers
Examples
--------