Skip to content

Instantly share code, notes, and snippets.

Ilgrim /
Created Aug 23, 2016 — forked from mattratleph/
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
Ilgrim /
Created Jan 9, 2017 — forked from messa/
Python asyncio + SSL TCP client/server example
#!/usr/bin/env python3
import asyncio
import multiprocessing
import os
import ssl
from time import sleep
port = 9000
Ilgrim /
Created Jan 13, 2017 — forked from vgoklani/
Using Flask to output Python data to High Charts
from flask import Flask, render_template
app = Flask(__name__)
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350):
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}]
title = {"text": 'My Title'}
Ilgrim / github-oauth2-client.php
Created Jan 13, 2017
Simple PHP example of using Github's OAuth 2 API
View github-oauth2-client.php
define('OAUTH2_CLIENT_ID', '');
define('OAUTH2_CLIENT_SECRET', '');
$authorizeURL = '';
$tokenURL = '';
$apiURLBase = '';
Ilgrim / README.rst
Created Jan 14, 2017 — forked from rduplain/README.rst
Demonstrate use of fixture with Flask-SQLAlchemy and Flask-Testing.
View README.rst

Demonstrate use of fixture with Flask-SQLAlchemy and Flask-Testing. February 13, 2011 Ron DuPlain <>

Post any feedback to:

Get this gist:

git clone git:// Flask-SQLAlchemy-Fixture
cd Flask-SQLAlchemy-Fixture
Ilgrim /
Created Mar 21, 2017 — forked from scturtle/
simple ftp server by python
#!/usr/bin/env python2
# coding: utf-8
import os,socket,threading,time
#import traceback
allow_delete = False
local_ip = socket.gethostbyname(socket.gethostname())
local_port = 8888
View gist:65d5bd5a61edad568173b76967a32ecf
class BTreeNode(object):
"""A B-Tree Node.
leaf : boolean, determines whether this node is a leaf.
keys : list, a list of keys internal to this node
c : list, a list of children of this node
def __init__(self, leaf=False):
Ilgrim /
Created Jul 26, 2017 — forked from gregvish/
Python 3.4 asyncio chat server example
from socket import socket, SO_REUSEADDR, SOL_SOCKET
from asyncio import Task, coroutine, get_event_loop
class Peer(object):
def __init__(self, server, sock, name):
self.loop = server.loop = name
self._sock = sock
self._server = server
Ilgrim / gist:9af9f4a4b24075e3fa3203f4578cca7c
Created Jul 31, 2017 — forked from berlinbrown/gist:4176103
Simple Java 2D Example, Double Buffering
View gist:9af9f4a4b24075e3fa3203f4578cca7c
* Copyright (c) 2006-2010 Berlin Brown and All Rights Reserved
* All rights reserved.
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
Ilgrim /
Created Aug 22, 2017 — forked from rji/
A simple SHA256 hashing example, written in Python using hashlib
# Generates ten data files, each 300 MB in size and filled with random data.
[[ ! -d "data/" ]] && mkdir "data/"
for i in {1..10}; do
dd if="/dev/random" of="data/file${i}" bs=1m count=300