Skip to content

Instantly share code, notes, and snippets.

View mnowotnik's full-sized avatar

Michał Nowotnik mnowotnik

View GitHub Profile
Normal mode default mappings.
{lhs} {rhs}
-------- -----------------------------
<TAB> <Plug>(vimfiler_switch_to_other_window)
j <Plug>(vimfiler_loop_cursor_down)
k <Plug>(vimfiler_loop_cursor_up)
gg <Plug>(vimfiler_cursor_top)
<C-l> <Plug>(vimfiler_redraw_screen)
<Space> <Plug>(vimfiler_toggle_mark_current_line)
<S-Space> <Plug>(vimfiler_toggle_mark_current_line_up)
@mnowotnik
mnowotnik / curry.py
Last active August 29, 2015 14:17
python curry
# -*- coding: utf-8 -*-
#author: Michał Nowotnik 2015
#public domain
def curry(func):
argc = func.func_code.co_argcount
def wrap(*args, **kwargs):
if argc <= len(args)+len(kwargs):
return func(*args, **kwargs)
fncp = partial(wrap, *args, **kwargs)
global !p
import string, vim
import textwrap
_snips_fns = {}
def py(*args):
import re
old_a = vim.eval('@a')
@mnowotnik
mnowotnik / gulpfile.js
Last active September 17, 2015 14:28 — forked from mlouro/gulpfile.js
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@mnowotnik
mnowotnik / gulpfile.js
Last active September 17, 2015 14:43 — forked from soin08/gulpfile.js
Gulpfile.js to use with Django projects. Based on gulpfile.js from Google Web Starter Kit.
//Based on gulpfile.js from Google Web Starter Kit.
//https://github.com/google/web-starter-kit
'use strict';
// Include Gulp & Tools We'll Use
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');
# 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
" 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
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,'\ \+')
#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) {
@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