Skip to content

Instantly share code, notes, and snippets.

View cycold's full-sized avatar

cy cycold

  • ShenZhen, China
View GitHub Profile
@cycold
cycold / clipboard.html
Created May 13, 2014 06:42
chrome浏览器支持从clipboard读取复制的数据 粘贴图片
Convert image from clipboard to base64 encoded data with JavaScript
http://stackoverflow.com/questions/11194209/convert-image-from-clipboard-to-base64-encoded-data-with-javascript
<div contenteditable></div>
$('div[contenteditable]').bind('paste', function(e) {
alert(123);
var data = e.originalEvent.clipboardData.items[0].getAsFile();
var elem = this;
var fr = new FileReader;
[
{
"class": "label_control",
"color": [255, 255, 255],
"shadow_color": [24, 24, 24],
"shadow_offset": [0, -1]
},
{
"class": "button_control",
"content_margin": [6, 5, 6, 6],
@cycold
cycold / shutdown-suspend.bat
Created May 9, 2014 08:46
windows关机前的确认脚本
@echo off
rem 更改cmd客户端字符集为UTF8
rem (如果要更改cmd字符集,需要在cmd命令行中手动输入chcp 65001 写在批处理文件中无效 并且只是对当前的cmd窗口有效 chcp
rem 批处理乱码一般都是字符集不对, 一般批处理都使用ANSI编码最好936为GBK cmd中文默认字符集)
rem chcp 65001
rem shutdown -s -t 300 延迟300秒后关机
rem 设置延迟变量赋值
setlocal enabledelayedexpansion
echo 关机前确认:
goto task1
.container{
width:95%;
height:200px;
background: #f90;
margin: 10px auto 0;
position: relative;
}
.box-1{
width:30%;
*{margin:0;padding:0;}
.text{
display: inline-block;
font-size:16px;
vertical-align: middle;/* 保证文字垂直居中 */
}
.box-1{
height:200px;
.container{
width:95%;
height:200px;
background: #f90;
margin: 10px auto 0;
position: relative;
}
/*
这里将left, right设为0 那么如果设置margin左右auto,就会 和relative定位的margin左右auto居中效果一致
<?php
add_action('admin_init', 'add_meta_boxes', 1);
function add_meta_boxes() {
add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high');
}
function repeatable_meta_box_display() {
global $post;
@cycold
cycold / working.sublime-project
Created April 10, 2014 09:29
sublime 项目配置文件示例
{
"folders":
[
{
"follow_symlinks": true,
"path": "text_notes"
},
{
"follow_symlinks": true,
"path": "H"
@cycold
cycold / Default (Windows).sublime-keymap
Created April 10, 2014 09:28
我的sublimeText3 key-map配置文件备份
[
{ "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" }
]
@cycold
cycold / css_resources.md
Created April 9, 2014 16:01 — 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