Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
<?php | |
/* | |
* 八皇后问题是一个非常有趣的问题,是由德国大数学家高斯首先提出来的。 | |
* 要求在国际象棋的棋盘上放置八个皇后,使她们不能互相攻击。 | |
* 即任何两个皇后不能处在同一行、同一列、同一条斜线上。 | |
* | |
* 问有多少种不同的摆法?并找出所有的摆法。 | |
* | |
* 问题分析: | |
* (1) 满足上述条件的八个皇后,必然是每行一个,每列一个。 |
import XMonad | |
import Data.Monoid | |
import System.Exit | |
import qualified XMonad.StackSet as W | |
import qualified Data.Map as M | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.EwmhDesktops |
<?php | |
include 'predis/predis.phar'; | |
class OnlineUsers { | |
/* time to consider user online */ | |
private $minutes = 5 ; | |
function online() { | |
/* current hour and minute */ |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
This gist assumes:
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
{# for twitter bootstrap specifically #} | |
{% block field_row %} | |
{% spaceless %} | |
<div class="control-group {% if errors|length > 0 %}error{% endif %}"> | |
{{ form_label(form, label|default(null)) }} | |
<div class="controls"> | |
{{ form_widget(form) }} | |
{{ form_errors(form)}} | |
</div> | |
</div> |
// 2024 Update, use URLSearchParams [https://caniuse.com/urlsearchparams] | |
export function createQueryString2(name: string, value: string, searchParams: any) { | |
const params = new URLSearchParams(searchParams); | |
params.set(name, value.toLowerCase()); | |
return params.toString(); | |
} | |
// ---- Original 2012 version, when browsers really sucked ---- | |
// Explicitly save/update a url parameter using HTML5's replaceState(). |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"time" | |
) | |
var urls = []string{ | |
"https://splice.com/", |