Skip to content

Instantly share code, notes, and snippets.

View linhuiw's full-sized avatar
👨‍💻
coding

无止休 linhuiw

👨‍💻
coding
View GitHub Profile
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.qiankun = {}));
}(this, (function (exports) { 'use strict';
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
function suffix(s1, s2) {
return s1.indexOf(s2, s1.length - s2.length) !== -1
};
function FindProxyForURL(url, host) {
var P = "PROXY 104.236.151.182:25;";
var D = "DIRECT";
if (suffix(host, '.cn') || isPlainHostName(host) || suffix(host, '.local') || suffix(host, '.xip.io') || suffix(host, '.dev') || /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i.test(host)) return D;
if (suffix(host, 'twimg.com')) return P;
if (suffix(host, 'googleusercontent.com')) return P;
@linhuiw
linhuiw / gist:c062ac9899f7c4ac1e2c
Created October 9, 2015 01:54 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@linhuiw
linhuiw / rails_resources.md
Created May 7, 2014 07:53 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@linhuiw
linhuiw / css_resources.md
Created May 7, 2014 07:53 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@linhuiw
linhuiw / javascript_resources.md
Created May 7, 2014 07:53 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@linhuiw
linhuiw / 0_reuse_code.js
Created May 7, 2014 07:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@linhuiw
linhuiw / gist:5812173
Created June 19, 2013 06:58
Cool tools
#! /bin/bash
#mutt 最好用的电子邮件程序
sudo apt-get -y install msmtp-mta msmtp mutt getmail4 procmail lynx wv w3m
mkdir -p ~/Mail
(cd ~/Mail && touch inbox sent postponed)
touch ~/.msmtprc
chmod -v 600 ~/.msmtprc
chmod -v 700 ~/.getmail
@linhuiw
linhuiw / js snippets
Created October 9, 2012 02:51
js snippets
/**
* ☆★☆★☆★☆★☆★☆JavaScript草稿集☆★☆★☆★☆★☆★☆
*
* By hustskyking
*/
//★JQuery★<!--<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>//-->
//★★★★★★★★公共部分★★★★★★★★
function printf(obj) {
@linhuiw
linhuiw / redline-complete.js
Created August 20, 2012 13:47
redline-complete
//
// Based on github.com/cloudhead/http-console
// An attempt at a simplified readline example.
//
var readline = require('readline')
, util = require('util')
, rl = readline.createInterface(process.stdin, process.stdout, completer)