Skip to content

Instantly share code, notes, and snippets.

View mnowotnik's full-sized avatar

Michał Nowotnik mnowotnik

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mnowotnik on github.
  • I am mnowotnik (https://keybase.io/mnowotnik) on keybase.
  • I have a public key ASA5zJNmZNgiWTPzDQQ7yY-XKl5q-vxuP0Pg_lW4qeEqjAo

To claim this, I am signing this object:

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# This snippet of code is released into the public domain.
# However, an attribution link is welcome.
# Run a job in the foreground after TIMEOUT seconds
# to make prompt rendering in a new session faster and more responsive.
# for example:
# pyenv_loader() {
# unset -f pyenv_load
@mnowotnik
mnowotnik / colors.properties
Last active February 4, 2019 15:35
Gruvbox-light-soft for Termux
foreground=#282828
background=#f2e5bc
color0=#f2e5bc
color1=#cc241d
color2=#98971a
color3=#d79921
color4=#458588
color5=#b16286
color6=#689d6a
color7=#665c54
@mnowotnik
mnowotnik / .style.yapf
Last active December 4, 2017 14:13
Sane yapf config
[style]
based_on_style=pep8
column_limit=100
continuation_indent_width=4
dedent_closing_brackets=true
coalesce_brackets=false
blank_line_before_nested_class_or_def=true
@mnowotnik
mnowotnik / example.puml
Created September 10, 2017 16:48 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram. The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@mnowotnik
mnowotnik / ycm_extra_conf.py
Created May 24, 2017 10:07
YouCompleteMe vim plugin conf file
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
#include <omp.h>
#include <random>
#include <vector>
#include <iostream>
#include <chrono>
using namespace std;
using namespace std::chrono;
std::vector<int> transform(const std::vector<int> &v) {
function! s:Eslint ()
cclose
let out = system('eslint '.expand("%"))
let errors = split(out, '\n')
let filename = Strip(errors[0])
let errors = errors[1:]
let q_list = []
echo errors
for err in errors
let err_split = split(err,'\ \+')
" based on : https://gist.github.com/kennyp/1069647
" assumes compile_commands.json is in the current working directory
function! s:Oclint ()
cclose
let out = system('oclint -p . '.expand("%"))
let errors = split(out, '\n')
let errors = map(errors,'split(v:val,":")')
let errors = filter(errors,'len(v:val) == 4')
let error_list = []
for e_list in errors
# Returns an array of fibonnaci numbers up to max_num
def fibonacci(max_num):
fib_arr = [1,2]
n_fib = 0
while n_fib < max_num:
n_fib = fib_arr[-2] + fib_arr[-1]
fib_arr.append(n_fib)
return fib_arr