###Browsers
- Chrome
- Firefox
###Editors && IDE
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
def getkey(): | |
"get key press without Enter" | |
import termios, sys, os | |
fd = sys.stdin.fileno() | |
old = termios.tcgetattr(fd) | |
new = termios.tcgetattr(fd) | |
new[3] = new[3] & ~TERMIOS.ICANON & ~TERMIOS.ECHO | |
new[6][TERMIOS.VMIN] = 1 |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
#author: rex | |
#blog: http://iregex.org | |
# | |
import re | |
from os.path import dirname as dirname |
### mysql | |
A "/etc/my.cnf" from another install may interfere with a Homebrew-built | |
server starting up correctly. | |
To connect: | |
mysql -uroot | |
To have launchd start mysql at login: | |
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents | |
Then to load mysql now: |
###Browsers
###Editors && IDE
;;; rex zone | |
;; show linum by default | |
(global-linum-mode t) | |
(setq linum-format " %03d ") | |
(setq display-time-day-and-date t) | |
(setq display-time-24hr-format t) |
const URL_REGEXP_PROTOCOL = '(?:(http|https):\/\/)'; | |
const URL_REGEXP_USER = '(?:[^\/]+?(?::[^\/]+?)?@)?'; | |
const URL_REGEXP_HOST = '(?:(?:(www\.)?(?:[\w\-]+\.)+(?:[a-z]{2,4}))|(?:(?:\d{1,3}\.){3}\d{1,3}))'; | |
const URL_REGEXP_PORT = '(?::\d{1,5})'; | |
const URL_REGEXP_QUERY = '(?:\/[\w\-\?\.\=\&\+\%\[\]\/#;@:~!]*)'; |
#!/bin/sh | |
# Curlicue - an OAuth wrapper for curl | |
# | |
# Copyright © 2010 Decklin Foster <decklin@red-bean.com> | |
# Please see README for usage information and LICENSE for license. | |
# Because HTTP responses from the OAuth "dance" will be percent-encoded, | |
# and we want to round-trip this data, we require that credentials files | |
# are also percent-encoded. Therefore, no decoding is done here. $1 is |
Process: Gohan [49601] | |
Path: /Applications/Gohan.app/Contents/MacOS/Gohan | |
Identifier: me.imach.gohanmac | |
Version: 1.0 (1.0) | |
App Item ID: 735180013 | |
App External ID: 86782801 | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [203] | |
Responsible: Gohan [49601] | |
User ID: 501 |
### | |
#所需的函数: | |
p_99, 使用js 内置的parseInt,做比较; | |
或 | |
re_99,使用正则式做匹配测试。 | |
如果只想匹配 2 位的数字,忽略1位的数字,将 [0-9]{1,2} 改为 [0-9]{2} 即可。 | |
### | |
p_99 = (degree) -> |