Skip to content

Instantly share code, notes, and snippets.

@MicahElliott
MicahElliott / colortrans.py
Created November 29, 2010 07:57
Convert values between RGB hex codes and xterm-256 color codes.
#! /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
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@1stvamp
1stvamp / mac-curl-ca-bundle.sh
Created March 22, 2012 12:50
Script to install cURL CA certificates on OS X without macports
#!/bin/bash
mkdir /tmp/curl-ca-bundle
cd /tmp/curl-ca-bundle
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2
tar xzf curl-7.22.0.tar.bz2
cd curl-7.22.0/lib/
./mk-ca-bundle.pl
if [ ! -d /usr/share/curl/ ]; then
sudo mkdir -p /usr/share/curl/
else
--- redirect.rb 2012-04-09 11:58:39.905024214 +0300
+++ redirect-pages.rb 2012-04-09 11:58:10.441025135 +0300
@@ -15,9 +15,9 @@
# find all posts with a redirect property and create a new page for each entry
def generate_redirects(site)
- site.posts.select{|x| x.data.key? 'redirects' }.each do |p|
+ (site.pages + site.posts).select{|x| x.data.key? 'redirects' }.each do |p|
p.data['redirects'].each do |r|
- redirect = RedirectPage.new(site, site.source, r, p.id)
@biovisualize
biovisualize / index.html
Last active February 15, 2017 13:25
Posting gist/blocks to blogger
<!-- Override Gist styling -->
<style type="text/css">
iframe{background-color: #0a0a0a;}
div.gist-syntax {background-color:#0a0a0a!important;}
div.gist {color:#ccc!important;}
span.nt, span.kd, span.k, span.o{color:aliceblue!important;}
.gist .gist-file{border-color:#444!important;}
.gist .gist-file .gist-meta{background-color:#0a0a0a!important;}
</style>
@mike-zhang
mike-zhang / udpProxy.go
Created October 8, 2012 15:58
Implementation of a UDP proxy in Golang
// Implementation of a UDP proxy
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
@dahu
dahu / gist:3986511
Last active April 22, 2024 13:02
Vim Motions
Large Object Motions:
(
)
{
}
[[
[]
][
]]
[m
if (getLangOpts().InterceptAllocationFunctions &&
getLangOpts().RTTI) {
bool UseSize = false;
IdentifierInfo *DeleteInterceptInfo =
&PP.getIdentifierTable().get("__op_delete_intercept__");
DeclareGlobalAllocatorInterceptFunctions(
DeclarationName(DeleteInterceptInfo), UseSize);
LookupResult R(*this, DeleteInterceptInfo, SourceLocation(),
LookupOrdinaryName);
@masuidrive
masuidrive / gist:5231110
Created March 24, 2013 08:45
clang options
OVERVIEW: LLVM 'Clang' Compiler: http://clang.llvm.org
USAGE: clang -cc1 [options] <inputs>
OPTIONS:
-### Print the commands to run for this compilation
--analyze Run the static analyzer
--migrate Run the migrator
--relocatable-pch Build a relocatable precompiled header
--serialize-diagnostics <value>