Skip to content

Instantly share code, notes, and snippets.

View miron's full-sized avatar
🧘‍♂️
Smashing Python for Fun and Profit

Miron miron

🧘‍♂️
Smashing Python for Fun and Profit
View GitHub Profile
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
// add this to <profile>/static/custom/custom.js to load vim keybindings:
$.getScript("/static/components/codemirror/keymap/vim.js", function() {
if (! IPython.Cell) return;
IPython.Cell.options_default.cm_config.keyMap = "vim";
});
@silverkors
silverkors / fileman.py
Created November 27, 2012 20:40
Useful filemanager for Pythonista, move files, delete and create files and directories
# -*- coding: utf-8 -*-
import os, sys, editor, shutil
from glob import glob
from scene import *
from time import time
from copy import deepcopy
from PIL import Image, ImageDraw, ImageFont
# https://gists.github.com/4034526
@mjwall
mjwall / screen.rb
Created October 14, 2011 14:05
Homebrew screen install with 256 colors and vertical splits
require 'formula'
class Screen <Formula
homepage 'http://www.gnu.org/software/screen/'
url 'http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz'
md5 '8506fd205028a96c741e4037de6e3c42'
# brew install --HEAD to get the latests, includes vertical split, mapped
# to C-a |
head 'git://git.savannah.gnu.org/screen.git', :branch => 'master'