Skip to content

Instantly share code, notes, and snippets.

View cycold's full-sized avatar

cy cycold

  • ShenZhen, China
View GitHub Profile
@cycold
cycold / emoji_image_replace.js
Created December 10, 2015 08:40 — forked from mwunsch/emoji_image_replace.js
Detect emoji unicode on a page, replace it with images (supplied by GitHub, for now). Goes great in your ~/.js
/**
*
* Here's a thing that will look through all the text nodes of a document, and
* upon encountering an emoji codepoint, will replace it with an image.
* For now, those images are pulled from GitHub, which isn't very nice, so I
* need to find a more suitable host.
*
* Much of this code was gleaned from staring at the minified GitHub JS.
*
* Copyright (c) 2013 Mark Wunsch. Licensed under the MIT License.
<?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">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>name</key>
@cycold
cycold / functions.js
Created February 12, 2015 03:27
commone js functions
function isFunction(fun){
return typeof fun === 'function';
}
function isObject(obj){
return toString.apply(obj) == '[object Object]';
}
function isString(str){
return typeof str === 'string';
}
function isNumeric(num){
@cycold
cycold / 0_reuse_code.js
Last active August 29, 2015 14:07
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
@cycold
cycold / sublime-other.sublime-keymap
Created September 11, 2014 06:24
sublime key shutcuts
[
{ "keys": ["alt+/"], "command": "auto_complete" },
{ "keys": ["ctrl+shift+c"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+shift+g"], "command": "find_all_under" },
{ "keys": ["ctrl+shift+x"], "command": "open_dir", "args": {"dir": "$file_path", "file": "$file_name"} },
{ "keys": ["ctrl+shift+s"], "command": "reveal_in_side_bar"},
{ "keys": ["ctrl+shift+z" ], "command": "view_in_browser" },
{ "keys": ["ctrl+shift+l"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+shift+h"], "command": "prev_view_in_stack" },
{ "keys": ["alt+l"], "command": "focus_neighboring_group" },
@cycold
cycold / Preferences.sublime-settings
Created September 11, 2014 03:33
sublime confiure
{
"auto_complete_commit_on_tab": false,
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"copy_with_empty_selection": false,
"default_encoding": "UTF-8",
"detect_slow_plugins": false,
"drag_text": false,
@cycold
cycold / sublime.sublime-keymap
Last active August 29, 2015 14:06
sublime key shutcuts
[
{ "keys": ["alt+/"], "command": "auto_complete" },
{ "keys": ["ctrl+shift+c"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+shift+g"], "command": "find_all_under" },
{ "keys": ["ctrl+shift+x"], "command": "open_dir", "args": {"dir": "$file_path", "file": "$file_name"} },
{ "keys": ["ctrl+shift+s"], "command": "reveal_in_side_bar"},
{ "keys": ["ctrl+shift+z" ], "command": "view_in_browser" },
{ "keys": ["ctrl+shift+l"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+shift+h"], "command": "prev_view_in_stack" },
{ "keys": ["alt+l"], "command": "focus_neighboring_group" },
@cycold
cycold / _vimrc
Created September 11, 2014 01:58
Gvim configure
"------default settings安装完就有放入设置---------------
set nocompatible "关闭兼容模式
"模仿win快捷键,如Ctrl+a 全选, Ctrl+c 复制 Ctrl + v 粘贴等
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
"设置无自动备份文件 如index.php~
set nobackup
@cycold
cycold / gist:c3a3a7df69ccacb29dd3
Created September 10, 2014 02:38
window.devicePixelRatio值支持与数值测试实例页面
<input type="button" id="button" value="点击弹出window.devicePixelRatio" />
document.getElementById("button").onclick = function() {
alert(window.devicePixelRatio);
};