Embeds SQL syntax highlighting inside Ruby heredocs labeled SQL. This will also work to embed other syntaxen, e.g., HTML.
(requires https://github.com/exu/pgsql.vim)
syntax include @SQL syntax/pgsql.vim| #! /usr/bin/env python | |
| """ Convert values between RGB hex codes and xterm-256 color codes. | |
| Nice long listing of all 256 colors and their codes. Useful for | |
| developing console color themes, or even script output schemes. | |
| Resources: | |
| * http://en.wikipedia.org/wiki/8-bit_color | |
| * http://en.wikipedia.org/wiki/ANSI_escape_code |
| " vim:fdm=marker | |
| " Editor basics {{{ | |
| " Behave like Vim instead of Vi | |
| set nocompatible | |
| " Show a status line | |
| set laststatus=2 | |
| " Show the current cursor position |
| # A xterm-256color based TERMINFO that adds the escape sequences for italic. | |
| # | |
| # Install: | |
| # | |
| # tic xterm-256color-italic.terminfo | |
| # | |
| # Usage: | |
| # | |
| # export TERM=xterm-256color-italic | |
| # |
Embeds SQL syntax highlighting inside Ruby heredocs labeled SQL. This will also work to embed other syntaxen, e.g., HTML.
(requires https://github.com/exu/pgsql.vim)
syntax include @SQL syntax/pgsql.vimEach of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/bin/bash | |
| # -------------------------------------------------------------------------------------------- | |
| # Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian) | |
| # | |
| # Run from the web: | |
| # bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh) | |
| # -------------------------------------------------------------------------------------------- | |
| # Set the Ruby version you want to install |
| hash = { 'foo' => 'bar' } | |
| # Version 1 | |
| hash = Hash[hash.map { |k, v| [k.to_sym, v] }] | |
| # Version 2 | |
| hash = hash.reduce({}) do |memo, (k, v)| | |
| memo.tap { |m| m[k.to_sym] = v } | |
| end |
| import Foundation | |
| #if os(iOS) | |
| import UIKit | |
| #else | |
| import AppKit | |
| #endif | |
| /// Return string value currently on clipboard | |
| func getPasteboardContents() -> String? { |
| <script type='text/javascript' src="js/jquery.min.js"></script> | |
| <script type='text/javascript'> | |
| // Size the parent iFrame | |
| function iframeResize() { | |
| var height = $('body').outerHeight(); // IMPORTANT: If body's height is set to 100% with CSS this will not work. | |
| parent.postMessage("resize::"+height,"*"); | |
| } | |
| $(document).ready(function() { | |
| // Resize iframe |
| #!/usr/bin/env python | |
| import random | |
| import struct | |
| import sys | |
| # Most of the Fat32 class was cribbed from https://gist.github.com/jonte/4577833 | |
| def ppNum(num): | |
| return "%s (%s)" % (hex(num), num) |