Skip to content

Instantly share code, notes, and snippets.

@guilhermechapiewski
guilhermechapiewski / mysql_to_omnigraffle.applescript
Created September 27, 2010 18:23
AppleScript to dump MySQL tables to OmniGraffle Pro.
(*
Copyright (c) 2008, Christian Mittendorf <christian.mittendorf@googlemail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list ofconditions and the following disclaimer. Redistributions in binary form
must reproduce the above copyright notice, this list of conditions and the
@mvasilkov
mvasilkov / gfm.py
Created November 22, 2010 21:11 — forked from christian-oudard/gfm.py
import re
from hashlib import md5
def gfm(text):
# Extract pre blocks.
extractions = {}
def pre_extraction_callback(matchobj):
digest = md5(matchobj.group(0)).hexdigest()
extractions[digest] = matchobj.group(0)
return "{gfm-extraction-%s}" % digest
@milkypostman
milkypostman / package.el
Created September 12, 2011 16:11
Function to update all packages in package.el
(defun package-update-all ()
"Update all packages"
(interactive)
(dolist (elt package-alist)
(let* ((name (car elt))
(file-name (symbol-name name))
(available-pkg (assq name package-archive-contents))
(available-version (and available-pkg
(package-desc-vers (cdr available-pkg))))
(current-version (package-desc-vers (cdr elt)))
@peccu
peccu / common.css
Created May 20, 2012 04:43 — forked from takumikinjo/.gitignore
HTML5 Presentation export for Org-mode
#speaker-note {
position:absolute;
left: 0;
top: 80%;
width: 100%;
height: 20%;
z-index: 8;
opacity: 0.75;
background-color: white;
overflow: auto;
@alexott
alexott / cedet-1.1-startup.el
Created October 28, 2012 13:42
Working configuration for CEDET 1.1 & below (only separate releases, not included into GNU Emacs)
;;; cedet-1.1-startup.el --- Working configuration for CEDET 1.1 & below
;; Copyright (C) Alex Ott
;;
;; Author: Alex Ott <alexott@gmail.com>
;; Keywords: CEDET 1.1,
;; Requirements: CEDET 1.1 or below
(load-file "~/tmp/cedet-1.1/common/cedet.el")
(require 'semantic-decorate-include)
@leoncamel
leoncamel / gist:2943625
Created June 17, 2012 06:04
my brew installation list
#!/bin/sh
# GNU coreutils
brew install coreutils
brew install findutils
brew install binutils
brew install patchutils
# gdb & gcc
brew install gdb
@denik
denik / ServerRack.py
Created June 5, 2011 09:31
class for managing multiple servers in gevent
# Class for managing multiple servers or anything with start() and stop() methods
class ServerRack(object):
def __init__(self, servers):
self.servers = servers
def start(self):
started = []
try:
@hideaki-t
hideaki-t / sqlite_fts_tokenizer.py
Created August 18, 2012 20:59
a proof of concept implementation of SQLite FTS tokenizers in Python
# coding: utf-8
"""
a proof of concept implementation of SQLite FTS tokenizers in Python
"""
from __future__ import print_function, unicode_literals
import sys
import ctypes
from ctypes import POINTER, CFUNCTYPE
import struct
@iloveitaly
iloveitaly / mysql2graffle.py
Created December 16, 2011 16:36
Visual Representation of MySQL Table in OmniGraffle
#! /usr/bin/pythonw
#
# Modified by Michael Bianco <info@cliffsidedev.com> on June 26, 2009
# Written by Thomas Pan at January 21, 2007
# mysql2graffle for Omnigraffle 5 is based on
# MyDBGraffle for OmniGraffle 4 which is based on Paul Davis' work at http://www.visualdistortion.org
#
# Requires:
#
# OmniGraffle 5
@rougier
rougier / rounded-box.el
Last active October 3, 2020 13:24
SVG Rounded box for Emacs
(require 'svg)
;; Rounded boxes using SVG:
;; This could be made into a function but size of text needs to be computed
(defun tag (text &optional foreground background font-size)
(let* ((font-size (or font-size 12))
;; The char-width ratio depends on the font family
(char-width (* font-size 0.58))
(char-height (+ font-size 1))