start new:
tmux
start new with session name:
tmux new -s myname
| #! /bin/sh | |
| # ------------------------------------------------------------------------------ | |
| # SOME INFOS : fairly standard (debian) init script. | |
| # Note that node doesn't create a PID file (hence --make-pidfile) | |
| # has to be run in the background (hence --background) | |
| # and NOT as root (hence --chuid) | |
| # | |
| # MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
| # INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
| # INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
| #ifndef SPINLOCKS_H | |
| #define SPINLOCKS_H | |
| #include <unistd.h> | |
| typedef volatile char spinlock_t; | |
| #if defined(__x86_64__) || defined(__i386) || defined(_X86_) | |
| # define CPU_PAUSE __asm__ ("pause") |
| // Copyright Dave Abrahams 2011. Distributed under the Boost | |
| // Software License, Version 1.0. (See accompanying | |
| // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <boost/math/constants/constants.hpp> | |
| #ifndef TRACE | |
| # define CONSTEXPR constexpr | |
| #else |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| """ | |
| Two things are wrong with Django's default `SECRET_KEY` system: | |
| 1. It is not random but pseudo-random | |
| 2. It saves and displays the SECRET_KEY in `settings.py` | |
| This snippet | |
| 1. uses `SystemRandom()` instead to generate a random key | |
| 2. saves a local `secret.txt` |
| """ | |
| Demo of json_required decorator for API input validation/error handling | |
| """ | |
| import inspect | |
| import functools | |
| import json | |
| from traceback import format_exception | |
| from flask import jsonify, request | |
| import sys |
| #!bash.exe | |
| export SSH_AUTH_SOCK=/tmp/.ssh-socket | |
| echo ; | |
| echo Starting connection with ssh-agent... | |
| ssh-add -l 2>&1 >/dev/null | |
| if [ $? = 2 ]; then | |
| rm -f /tmp/.ssh-script /tmp/.ssh-agent-pid /tmp/.ssh-socket | |
| # Exit status 2 means couldn't connect to ssh-agent; start one now | |
| echo Creating new ssh-agent... | |
| ssh-agent -a $SSH_AUTH_SOCK > /tmp/.ssh-script |
| // Facebook SDK | |
| angular.module('facebook', []) | |
| .directive('fb', ['$FB', function($FB) { | |
| return { | |
| restrict: "E", | |
| replace: true, | |
| template: "<div id='fb-root'></div>", | |
| compile: function(tElem, tAttrs) { | |
| return { | |
| post: function(scope, iElem, iAttrs, controller) { |
| #include "tweetnacl.h" | |
| #define FOR(i,n) for (i = 0;i < n;++i) | |
| #define sv static void | |
| typedef unsigned char u8; | |
| typedef unsigned int u32; | |
| typedef unsigned long long u64; | |
| typedef long long i64; | |
| typedef i64 gf[16]; |