Skip to content

Instantly share code, notes, and snippets.

# 规则配置仅供参考,适用于 Surge iOS & Mac;
# 包含 Proxy Group、URL Rewrite 特性;
# 包含 Reject 规则,用于拦截广告、行为分析、数据统计;
# 屏蔽 Hao123、百度联盟广告以及部分运营商网页漂浮广告;
# Surge for Mac 简明指南 http://bit.ly/1TATRaG
[General]
# warning, notify, info, verbose
loglevel = notify
ipv6 = true
@gzeureka
gzeureka / 00_notes.md
Created December 22, 2015 02:06 — forked from Deraen/00_notes.md
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required
@gzeureka
gzeureka / HOWTO.mac-set-file-icon.md
Created December 4, 2015 00:39 — forked from philipptempel/HOWTO.mac-set-file-icon.md
How to set an icon for a file type on Mac?

Q: How to set an icon for some file types throughout the whole system?

For example, I have text files that ends with .scala extension and I want to associate an icon for that files through the whole system and for any newly created file of this extension.

Gisted from http://superuser.com/questions/178316/how-to-set-an-icon-for-a-file-type-on-mac

All credits go to the author of the accepted and top-voted answer by Daniel Beck

A: How to set an icon for a file type on Mac!

@gzeureka
gzeureka / Clojure.plist
Created December 3, 2015 01:15 — forked from stig/Clojure.plist
Clojure language module based on the newlisp package by Seth Dillingham and Pete B. Anonymous.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
ABOUT:
Clojure language module based on the newlisp package by
Seth Dillingham <[email protected]>
and Pete B. Anonymous.
@gzeureka
gzeureka / ns-cheatsheet.clj
Created November 29, 2015 07:06 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
@gzeureka
gzeureka / trailing-slash-middleware
Created November 26, 2015 13:45 — forked from dannypurcell/trailing-slash-middleware
Ring middleware fn. Removes a trailing slash from the uri before calling the handler.
(defn ignore-trailing-slash
"Modifies the request uri before calling the handler.
Removes a single trailing slash from the end of the uri if present.
Useful for handling optional trailing slashes until Compojure's route matching syntax supports regex.
Adapted from http://stackoverflow.com/questions/8380468/compojure-regex-for-matching-a-trailing-slash"
[handler]
(fn [request]
(let [uri (:uri request)]
(handler (assoc request :uri (if (and (not (= "/" uri))
原帖地址: http://topic.csdn.net/u/20110113/19/b0d5d506-4307-428b-a61d-7974aa66a2da.html
首先要说明的是:这里介绍的方法都是大部分是本人“悟”出来的,所以网上难有流传!
好方法不能自己私藏,否则就白忙乎这几天了,分享给有需要的朋友们。如果有转载,敬请注明来自*CSDN老邓*作品。
呵呵,给自己打广告,实在是无耻之极,权当无聊之时打字之用。
欢迎流传,为最优秀的分布式版本管理系统Git做宣传!!
步骤:
1. 下载:http://loaden.googlecode.com/files/gitconfig.7z
2. 解压到:<MsysGit安装目录>/cmd/,例如:D:\Program Files\Git\cmd
@gzeureka
gzeureka / INSTALL.md
Created February 23, 2014 06:15 — forked from namuol/INSTALL.md

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

;;; Written when pondering
;;; http://stackoverflow.com/questions/9086926/create-a-proxy-for-an-specific-instance-of-an-object-in-clojure
(defmacro delegating-proxy [o class-and-ifaces ctor-args & impls]
(let [oname (gensym)]
(letfn [(delegating-impls [^java.lang.reflect.Method ms]
(let [mname (symbol (.getName ^java.lang.reflect.Method (first ms)))
arity-groups (partition-by #(count (.getParameterTypes ^java.lang.reflect.Method %)) ms)
max-arity (max-key #(count (.getParameterTypes ^java.lang.reflect.Method %)) ms)]
`(~mname
@gzeureka
gzeureka / Make callback-based API synchronous.clj
Last active December 15, 2015 07:59
Make callback-based API synchronous
; a callback-based API
(defn call-service [arg1 arg2 callback-fn]
; ...perform service call, eventually invoking callback-fn with results...
(future (callback-fn (+ arg1 arg2) (- arg1 arg2))))
(defn sync-fn [async-fn]
(fn [& args]
(let [result (promise)]
(apply async-fn (conj (vec args) #(deliver result %&)))
@result)))