Skip to content

Instantly share code, notes, and snippets.

View neekey's full-sized avatar
🎯
Focusing

Neekey neekey

🎯
Focusing
View GitHub Profile
@neekey
neekey / gfw.list
Created July 31, 2012 05:19
翻墙代理规则
function regExpMatch(url, pattern) {
try { return new RegExp(pattern).test(url); } catch(ex) { return false; }
}
function FindProxyForURL(url, host) {
if (shExpMatch(url, "*://*.google.com/*") || shExpMatch(url, "*://google.com/*")) return 'PROXY 127.0.0.1:8087';
if (shExpMatch(url, "*://*.google.com.*/*") || shExpMatch(url, "*://google.com.*/*")) return 'PROXY 127.0.0.1:8087';
if (shExpMatch(url, "*://*.google-analytics.com/*") || shExpMatch(url, "*://google-analytics.com/*")) return 'PROXY 127.0.0.1:8087';
if (shExpMatch(url, "*://*.googleapis.com/*") || shExpMatch(url, "*://googleapis.com/*")) return 'PROXY 127.0.0.1:8087';
if (shExpMatch(url, "*://*.googlecode.com/*") || shExpMatch(url, "*://googlecode.com/*")) return 'PROXY 127.0.0.1:8087';
@neekey
neekey / fixhover.js
Created August 13, 2012 07:31
IE6 Hover fix
/**
* IE6 Hover fix
* @depend KISSY
* @author 隐若 <yinruo.nyj@taobao.com>
*/
(function( S ){
'use strict';
@neekey
neekey / neekey.config.terminal
Created August 23, 2012 03:10
My terminal color configuration
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw
IDEAEAGAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj
dF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FITltiaWttcn2GjpGa
@neekey
neekey / textReplace.js
Created August 24, 2012 03:24
对文本进行替换(关键词搜索),提供不区分大小写
/**
* 文本替换
* @param target 需要搜索的文本
* @param keywords 关键字
* @param decorator 对搜索到的关键词进行构造
* @param ifSensitive 大小写是否区分,默认不区分
* @return {*}
*/
function textReplace( target, keywords, decorator, ifSensitive ){
@neekey
neekey / hosts
Created August 27, 2012 03:38
My hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
@neekey
neekey / loader.js
Created September 4, 2012 02:57
跨域iframe自适应高度脚本
/**
* 跨域iframe自适应高度脚本
*/
var Loader = new function(){
var doc = document,body = doc.body,
self = this,
//获取url中的参数
getRequest = function(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i"),
@neekey
neekey / proxy.html
Created September 4, 2012 02:58
iframe - proxy
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>iframe - proxy</title>
</head>
<body>
<script>
@neekey
neekey / grunt.js
Created September 4, 2012 06:29
grunt-compass config
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
meta: {
version: '0.1.0',
banner: '/*! PROJECT_NAME - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://www.jvsoftware.com/\n' +
@neekey
neekey / change.js
Created September 20, 2012 14:36
Simple LESS to SASS
// 所有的mixin
^\s*\.([\w\s-_]*\s*\([\s\$,\w-_\:]*\)\s*\{) --> @mixin $1
// 所有对于mixin的调用
^\s*\.([\w-_]*\(.*\);) --> @include $1;
// 所有不需要参数的mixin
^\s*(\.[\w-_]*;) --> @extend $1;
@neekey
neekey / grunt.js
Created October 25, 2012 10:37
grunt.js example
/*global module:false*/
module.exports = function (grunt) {
grunt.initConfig({
meta:{
/* 发布版本号 */
publish: 20120925
},
watch:{