This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun get-repo-url (arg) | |
(let* ((remote (if arg "upstream" (nth 2 (s-split "/" (magit-get-tracked-ref))))) | |
(remote-url (magit-get "remote" remote "url")) | |
(fragments (s-split "[:/@]/?/?" (s-chop-suffix ".git" remote-url)))) | |
(concat "http://" (s-join "/" (cdr fragments))))) | |
(defun open-in-repo (arg) | |
(interactive "P") | |
(let* ((url (get-repo-url arg)) | |
(branch (if arg "master" (magit-get-current-branch))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# A pre-commit hook for git to lint JavaScript files with jshint | |
# @see https://github.com/jshint/jshint/ | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reference https://bitbucket.org/xuxiaodong/dotman/src/cb7f1e6fb338/.tmux.conf | |
set -g default-terminal "screen-256color" | |
set -g display-time 3000 | |
set -g history-limit 65535 | |
set -g base-index 1 | |
set -g pane-base-index 1 | |
set -s escape-time 0 | |
# key bindings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- copy this to YOUR_THEME.tmTheme--> | |
<dict> | |
<key>name</key> | |
<string>diff: deleted</string> | |
<key>scope</key> | |
<string>markup.deleted</string> | |
<key>settings</key> | |
<dict> | |
<key>background</key> | |
<string>#EAE3CA</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based off of https://gist.github.com/creationix/5544019 | |
// these could probably be condensed more, but I'm just doing this | |
// quickly | |
exports = module.exports = run; | |
exports.call = call; | |
exports.invoke = invoke; | |
exports.bind = bind; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* thumb截中间区域 */ | |
fieldset { | |
display: inline-block; | |
border: 1px solid #ddd; | |
} | |
.thumb { | |
position: relative; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTPUSER = 'mylogin' | |
HTTPPASS = 'mypassword' | |
from wsgiproxy.app import WSGIProxyApp | |
from base64 import encodestring | |
proxyapp = WSGIProxyApp('http://remote.server.domain.com/') | |
# Craft Basic Auth header. Don't forget to strip the trailing \n. | |
HTTPAUTH = 'Basic ' + encodestring(HTTPUSER+':'+HTTPPASS).strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bottle | |
from wsgiproxy.app import WSGIProxyApp | |
# Remove "hop-by-hop" headers (as defined by RFC2613, Section 13) | |
# since they are not allowed by the WSGI standard. | |
FILTER_HEADERS = [ | |
'Connection', | |
'Keep-Alive', | |
'Proxy-Authenticate', | |
'Proxy-Authorization', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adapted from https://code.google.com/p/wsgi-proxy | |
from httplib import HTTPConnection | |
from urlparse import urlparse | |
import copy | |
import logging | |
import mimetypes | |
import os | |
_hoppish = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 6) then: | |
// ie === 0 | |
// If you're in IE (>=6) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
OlderNewer