Skip to content

Instantly share code, notes, and snippets.

View norfish's full-sized avatar
🎯
Focusing

李永翔 norfish

🎯
Focusing
View GitHub Profile

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

<link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
$("h2,h3,h4,h5,h6").each(function(i,item){
var tag = $(item).get(0).localName;
@norfish
norfish / LICENSE.md
Last active August 29, 2015 14:06 — forked from brandonb927/LICENSE.md
       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
               Version 2, December 2004

Copyright (C) 2012 Brandon B. brandon@brandonbrown.io

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

Shell脚本编程30分钟入门
====================
## 什么是Shell脚本
### 示例
看个例子吧:
#!/bin/sh
cd ~
mkdir shell_tut
cd shell_tut
@norfish
norfish / select.jsx
Last active August 29, 2015 14:18 — forked from jbottigliero/select.jsx
/** @jsx React.DOM */
define(['reactjs'], function(React){
return React.createClass({
getDefaultProps: function(){
return {
multiple: false
/*
name: 'mySelect'
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({
@norfish
norfish / keyboard.js
Created July 15, 2016 11:37
keyboard events - rn
//安卓不支持willShow方法,统一在didShow中处理
RCTDeviceEventEmitter.addListener(Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow', evt=> {
if (!writeStore.isLoggingin) {
dispatcher.dispatch({
namespace: 'write',
action: 'keyboardShow',
data: {
keyboardHeight: evt.endCoordinates.height
@norfish
norfish / isElementVisible.js
Last active May 19, 2017 08:59
判断元素在是否在可视区域 check element in viewport(include part of)
// include part of the element
// 包含元素的一部分区域在可以区域
function isElementVisble(el) {
if(!el) {
return;
}
var viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var elPos = el.getBoundingClientRect();
@norfish
norfish / ios-scroll.js
Created October 23, 2017 09:21
ios-scorll for not overflow
/**
* author: fa-ge
* github: https://github.com/fa-ge/LocalScrollFix
*/
;(function() {
function createHeadTag() {
var styleNode = document.createElement('style')
styleNode.className = 'localscrollfix-head'
document.head.appendChild(styleNode)
@norfish
norfish / toast.js
Created January 25, 2018 11:33
移动端touch toast,依赖 jquery
/**
* @desc: Toast
* @authors: yongxiang.li
* @date: 2016-08-10 18:49:05
*
* Toast('message')
*/
// TODO 增加位置自定义