Taken from here
Add remonte branch:
git remote add --track master mleung git://github.com/mleung/feather.git
Verify:
git remote
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
/* | |
A (very) WIP collection of optimized/recommended jQuery plugin patterns | |
from @addyosmani, @cowboy, @ajpiano and others. | |
Disclaimer: | |
----------------------- | |
Whilst the end-goal of this gist is to provide a list of recommended patterns, this | |
is still very much a work-in-progress. I am not advocating the use of anything here | |
until we've had sufficient time to tweak and weed out what the most useful patterns |
[alias] | |
vommit = !sh -c \"cat ~/.gitvommit\" |
<!--[if mso]> | |
<center> | |
<table><tr><td width="580"> | |
<![endif]--> | |
<div style="max-width:580px; margin:0 auto;"> | |
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p> | |
</div> | |
<!--[if mso]> |
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
Taken from here
Add remonte branch:
git remote add --track master mleung git://github.com/mleung/feather.git
Verify:
git remote
/* | |
* A simple plugin for easier star rating markup using FontAwesome.io | |
* https://github.com/auxiliary/enrate | |
*/ | |
function enrate() | |
{ | |
$("[class^=enrate-]").each(function(){ | |
var parsed_data = this.className.split(' ')[0].match(/enrate-(\d)-([a-z])-(\d)/); | |
var num = parsed_data[1]; | |
var has_half = parsed_data[2] == "h" ? true : false; |
#!/usr/bin/python | |
import SimpleITK as sitk | |
import vtk | |
import numpy as np | |
import sys | |
from vtk.util.vtkConstants import * | |
filename = sys.argv[1] |
// | |
// Example of communication with a subprocess via stdin/stdout | |
// Author: Konstantin Tretyakov | |
// License: MIT | |
// | |
#include <ext/stdio_filebuf.h> // NB: Specific to libstdc++ | |
#include <sys/wait.h> | |
#include <unistd.h> | |
#include <iostream> |
This is an example of a socket-activated per-connection service (which is usually referred to as inetd-like service). A thorough explanation can be found at http://0pointer.de/blog/projects/inetd.html.
The key point here is to specify Accept=yes
, which will make the socket accept connections (behaving like inetd) and pass
only the resulting connection socket to the service handler.