Skip to content

Instantly share code, notes, and snippets.

View cyjake's full-sized avatar

Chen Yangjian cyjake

View GitHub Profile
@nicStuff
nicStuff / redis-migrate.sh
Last active June 5, 2024 17:54
Comfort tool for migrating redis keys among instances. Supports KEYS syntax matching, authentication and TTL
#!/bin/bash
######
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
# TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
######
@cyjake
cyjake / subp
Last active August 29, 2015 14:02
Simple subl wrap that is project configuration aware
#!/usr/bin/env node
'use strict';
/* jshint asi: true */
var fs = require('fs')
var path = require('path')
var spawn = require('child_process').spawn
@luckydrq
luckydrq / struts2_action.js
Last active August 29, 2015 13:56
post for `structs2 action`
/* Structs2的对象序列化
*
* Example:
* {a:'a', b:[{c:'c'}, {d:'d'}]}
*
* => {'a':'a', 'b[0].c': 'c', 'b[1].d': 'd'}
*
*/
function flattern(o) {
var result = {};
@yisibl
yisibl / SassMeister-input.scss
Created December 20, 2013 08:45
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@yisibl
yisibl / HTML-tags.md
Last active January 26, 2024 06:58
常用的 HTML 头部标签

常用的 HTML 头部标签

详细介绍参见原文:yisibl/blog#1

<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
    <meta charset='utf-8'> <!-- 声明文档使用的字符编码 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用 IE 最新版本和 Chrome -->
@nuysoft
nuysoft / expose.js
Last active December 31, 2015 10:39
模块化 Modular
"use strict";
/* global window */
/* global define */
/* global KISSY */
/*
https://gist.github.com/nuysoft/7974409
*/
# How to create a favicon with multiple image sizes and keep alpha transparency
- export your images in the desired sizes (16x16, 32x32 ... max 256x256) as PNGs + alpha
- install ImageMagick
Run this command (replacing the .png files for your own images):
convert favicon-16.png favicon-32.png favicon-64.png -colors 256 -alpha background favicon.ico
@Justineo
Justineo / createStyle.js
Last active November 24, 2016 09:05
Correct way to create stylesheets dynamically
function createStyle(styleText) {
var style = document.createElement('style');
style.type = 'text/css';
// <style> element must be appended into DOM before setting `cssText`
// otherwise IE8 will interpret the text in IE7 mode.
document.body.appendChild(style);
if (style.styleSheet) {
style.styleSheet.cssText = styleText;
} else {
@luckydrq
luckydrq / connect.js
Last active December 21, 2015 05:09
Connect源码解析
var EventEmitter = require('events').EventEmitter
, proto = require('./proto')
, utils = require('./utils')
, path = require('path')
, basename = path.basename
, fs = require('fs');
//应用补丁,封装了一些方法
require('./patch');