Skip to content

Instantly share code, notes, and snippets.

@sgsheg
sgsheg / dabblet.css
Created April 25, 2014 02:26
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.grebtn {
margin-left: 10px;
margin-top: 10px;
display: inline-block;
padding: 0.25em 1.25em;
border: 1px solid;
@sgsheg
sgsheg / gist:81926d796a425c63820c
Last active August 29, 2015 14:02
vimrc on my linux
" vim-sublime - A minimal Sublime Text -like vim experience bundle
" http://github.com/grigio/vim-sublime
" Best view with a 256 color terminal and Powerline fonts
set nocompatible
filetype off
set rtp+=~/.vim/bundle1/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
@sgsheg
sgsheg / gist:efbc8fef006d83effd10
Last active August 29, 2015 14:02
vimrc on Windows
set bsdir=buffer
set autochdir
set enc=utf-8
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8
set helplang=cn
source $VIMRUNTIME/delmenu.vim
@sgsheg
sgsheg / gist:a90b0de9cd205f7ea1d5
Last active August 29, 2015 14:02
windows搭建nodejs开发环境

title: windows搭建nodejs开发环境 date: 2014-01-07 15:22:42 tags: windows, nodejs

  1. 下载nodejs

nodejs下载地址

这里我选择的是.exe文件.

@sgsheg
sgsheg / gist:4269c43db80ab99abee2
Created June 8, 2014 03:07
windows dos操作指令

windows dos操作指令


  1. 使用cd命令直接退回到当前目录下.

  2. 使用dir命令分屏查看目录下的文件列表.

    • dir是Directory(目录)的缩写,该命令的作用是显示某个磁盘上的全部或者部分文件目录,是DOS下使用频率最高的命令之一.

        dir /p 		-->显示满一屏后自动暂停,按任意键继续
      
@sgsheg
sgsheg / gist:7f625c6cd150e8f4dad5
Last active August 29, 2015 14:02
Make a DIV Into a Link

I am looking for an XHTML 1.1 valid way to make a DIV into a clickable link.

More better:

You can't make the div a link itself, but you can make an <a> tag act as a block, the same behaviour a <div> has.

a {
    display: block;

}

@sgsheg
sgsheg / gist:a888017d69a44b296195
Created June 8, 2014 03:13
MySQL必知必会

Mysql基本

========

  1. 检索数据
    • 检索单个列数据
    • 检索多个列数据
    • 检索所有列数据
    • 检索不同的值
      • 使用 DISTINCT关键字
      • 不能部分使用DISTINCT,关键字用于所有列,不仅仅是跟在其后的列。
  • 限制结果
#!/bin/sh
#
# Shell script that configures gnome-terminal to use solarized theme
# colors. Written for Ubuntu 11.10, untested on anything else.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Adapted from these sources:
# https://gist.github.com/1280177
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/
@sgsheg
sgsheg / gist:218fa339c0ea53a56e24
Last active August 29, 2015 14:03
input only numberic
function validate(evt) {
	var theEvent = evt || window.event;
	var key = theEvent.keyCode || theEvent.which;
	key = String.fromCharCode( key );
	var regex = /[0-9]|\./;
	if( !regex.test(key) ) {
		// alert('hello')
	theEvent.returnValue = false;
	if(theEvent.preventDefault) theEvent.preventDefault();

}

@sgsheg
sgsheg / gist:9123320a4486cbb619e3
Created July 29, 2014 08:25
make div center the screen jquery plugin
jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + 
                        $(window).scrollTop()) + "px");
    this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + 
                        $(window).scrollLeft()) + "px");
    return this;

}