Skip to content

Instantly share code, notes, and snippets.

@reklis
reklis / node-w3c-log-input.js
Created September 5, 2013 20:38
Example of tailing standard w3c log files into brightcontext as an input
#!/usr/bin/env node
/*global require, console */
(function () {
'use strict';
var
bcc = require('brightcontext'),
argv = require('optimist')
@reklis
reklis / mancolors.zsh
Created August 16, 2013 13:37
blue+white man colors
# save to ~/.oh-my-zsh/colors/mancolors.zsh and add 'mancolors' to your ~/.zshrc plugin load list
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;34m") \
LESS_TERMCAP_md=$(printf "\e[1;34m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
sudo su -
# install node
yum -y install git-all
# latest
cd /opt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>bcc + webrtc</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
function gitprompt() {
local NONE="\033[0m" # unsets color to term's fg color
# regular colors
local K="\033[0;30m" # black
local R="\033[0;31m" # red
local G="\033[0;32m" # green
local Y="\033[0;33m" # yellow
local B="\033[0;34m" # blue
local M="\033[0;35m" # magenta
@reklis
reklis / CountdownView.h
Created February 11, 2013 15:45
Countdown View using FlipCounter
#import <UIKit/UIKit.h>
#import "FlipCounterView.h"
void SplitTimeIntervalIntoComponents(NSTimeInterval t, int* hours, int* minutes, int* seconds);
@protocol CountdownViewDelegate;
@interface CountdownView : UIView
testing
@reklis
reklis / makefatlib.sh
Created July 25, 2012 20:46
Make a simulator+device .a file with headers
# http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
TARGET_NAME=<< name of your target or an environment variable >>
CONFIGURATION=Release
DEVICE=iphoneos
SIMULATOR=iphonesimulator
FAT=universal
OUTPUT=build
LIBRARY_NAME=lib${TARGET_NAME}.a
@reklis
reklis / mainpage.diff
Created May 11, 2012 20:40
mainpage support
diff --git a/templates/default/publish.js b/templates/default/publish.js
index 2adf9e2..6b3e2f4 100644
--- a/templates/default/publish.js
+++ b/templates/default/publish.js
@@ -12,8 +12,10 @@
@param {Tutorial} tutorials
*/
publish = function(data, opts, tutorials) {
+ var defaultTemplatePath = 'templates/default';
+ var templatePath = (opts.template) ? opts.template : defaultTemplate;
@reklis
reklis / discount-null-pointer-dereference-fixes-no-whitespace.diff
Created March 8, 2012 18:13
discount-null-pointer-dereference-fixes-no-whitespace.diff
diff --git a/generate.c b/generate.c
index 8e82afd..f3a1bd9 100644
--- a/generate.c
+++ b/generate.c
@@ -652,6 +652,7 @@ linkyformat(MMIOT *f, Cstring text, int image, Footnote *ref)
if ( f->flags & IS_LABEL )
___mkd_reparse(T(text), S(text), tag->flags, f, 0);
else if ( tag->link_pfx ) {
+ if (ref) {
printlinkyref(f, tag, T(ref->link), S(ref->link));