Skip to content

Instantly share code, notes, and snippets.

View health.erl
-module(health).
-behaviour(gen_server).
-export([start_link/0,
check/0, alert/0, dump/0,
threshold/1, poll/1, url/1
]).
-export([init/1, handle_call/3]).
View Directives Inheritance
Reusing an AngularJS Directive core code. The idea is to:
** 1. conceal the actual directive behaviour in a separate JS "class",
** 2. store that in an Angular service,
** 3. inject that service into an Angular directive,
** 4. just have the directive factory function return the constructed instance of the "class".
That is to separate the directive core code from the actual directive factory.
Then one actually wants to inherit a directive core "class" from another. It's not really a matter of JS inheritance, but more on how to inject one into the other by means of Angular modules, without actually instantiating none of them until needed,
View directives.js
// Define core directive code + attributes and store that as a module value
angular.module('com.namespace.directives').value('MyDirectiveCore', MyDirectiveCore);
function MyDirectiveCore($compile) {
this.restrict = 'A';
this.priority = 10;
this.link = postLink;
return this;
View console.xml
<?xml version="1.0"?>
<settings>
<console change_refresh="10" refresh="100" rows="20" columns="98" buffer_rows="500" buffer_columns="0" init_dir="c:\" start_hidden="0" save_size="1" shell="c:\bip\git\bin\sh.exe --login -i">
<colors>
<color id="0" r="0" g="43" b="54"/>
<color id="1" r="38" g="139" b="210"/>
<color id="2" r="133" g="153" b="0"/>
<color id="3" r="42" g="161" b="152"/>
<color id="4" r="220" g="50" b="47"/>
<color id="5" r="211" g="54" b="130"/>
View file.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Hello</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
Hello World
</body>
View gist:5125292
<!-- BiwaScheme 0.6.1 -->
<html>
<head>
<title>enchant.js sample in BiwaScheme</title>
</head>
<body>
<div id="enchant-stage" />
@miebach
miebach / git-vlog
Created Jul 29, 2012 — forked from asabaylus/git-vlog
Git visual log for the console
View git-vlog
http://www.baylus.com/a-nice-visual-log-for-git-command-line/
A nice visual log for Git command line
I like having a quick visual log for Gits command line. Here’s a little git alias which’ll display a brief and colorful summary for your projects.
Enter the following code in terminal or git bash.
You can now generate a visual tree style log, open your shell
@miebach
miebach / install_riak.sh
Created Apr 8, 2012 — forked from lanius/install_riak.sh
Install riak 1.1.2 and R14B03 on a minimal Ubuntu 10.04 LTS server
View install_riak.sh
# Install riak-0.14.2rc8 to Ubuntu 10.04 LTS 32 bit
# make sure you have a compatible build system and the ncurses and openssl
# development libraries installed, also git and curl:
sudo aptitude install build-essential libncurses5-dev openssl libssl-dev git-core curl -y
# download, build and install Erlang:
ERLANG=/opt/erlang
View example.sh
#! /bin/sh
# Script to provide answer for question:
# http://stackoverflow.com/questions/5149872/how-to-git-remote-add-and-track-a-branch-in-the-same-filesystem
echo create origin
mkdir origin
cd origin/
git init --bare
cd ..
View gist:435950
# colors for ls, etc.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
}
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\u@\h \[\033[01;34m\]\w\[\033[01;35m\]$(parse_git_branch)\[\033[01;34m\] \$ \[\033[00m\]'
else
PS1='\[\033[01;37m\]\w\[\033[00;35m\]$(parse_git_branch)\[\033[00m\] \$ '
fi