Skip to content

Instantly share code, notes, and snippets.

View suxiaogang's full-sized avatar
🙄
busy writing bugs

Sam Su suxiaogang

🙄
busy writing bugs
  • NULL
  • UTM Zone 49
View GitHub Profile
@suxiaogang
suxiaogang / jQuery_window
Created August 31, 2014 04:23
jQuery_window
alert($(window).height()); //浏览器当前窗口可视区域高度
alert($(document).height()); //浏览器当前窗口文档的高度
alert($(document.body).height());//浏览器当前窗口文档body的高度
alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin
alert($(window).width()); //浏览器当前窗口可视区域宽度
alert($(document).width());//浏览器当前窗口文档对象宽度
alert($(document.body).width());//浏览器当前窗口文档body的高度
alert($(document.body).outerWidth(true));//浏览器当前窗口文档body的总宽度 包括border padding margin
// 获取页面的高度、宽度
CREATE DATABASE IF NOT EXISTS `blog_mvc` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `blog_mvc`;
-- MySQL dump 10.13 Distrib 5.6.13, for osx10.6 (i386)
--
-- Host: 127.0.0.1 Database: blog_mvc
-- ------------------------------------------------------
-- Server version 5.6.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@suxiaogang
suxiaogang / CreateJavaProject.java
Created June 23, 2014 12:04
CreateJavaProject.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
@suxiaogang
suxiaogang / responsive.css
Last active August 29, 2015 14:02
responsive.css
/*iPhone < 5*/
@media screen and (device-aspect-ratio: 2/3) {
.content{
width: 100%;
}
}
/*iiPhone 5*/
@media screen and (device-aspect-ratio: 40/71) {
.content{
/**
* 多个数组进行合并
*
* @author Sam Su
* @date 2013-07-12
* @param <T>
* @param first
* @param rest
* @return
*/
@suxiaogang
suxiaogang / ValidateJava.java
Created June 12, 2014 09:05
validated Identifier
/**
* 判断输入的字符串是否为Java保留的关键字
* @date 2013-08-05
* 不合法时返回true;
* 校验通过返回false;
*/
public static boolean validateReservedKeywords(String inputString) {
boolean flag = false;
final String[] keywords =
{"abstract", "continue", "for", "new", "switch", "assert", "default", "if",
@suxiaogang
suxiaogang / MultipleSelectionCombo.java
Last active December 3, 2020 21:49
SWT Multiple Selection Combo
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@suxiaogang
suxiaogang / V2EX.css
Last active June 22, 2022 02:55
V2EX.CSS
* {
font-family: PingFang SC, Helvetica, 'Luxi Sans', 'DejaVu Sans', Tahoma, 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
}
.wwads-cn {
display: none;
}
body {
background-image: none;
<script>
$(function(){
if($.browser.msie) {
alert("IE浏览器");
}else if($.browser.opera) {
alert("opera浏览器");
}else if($.browser.mozilla) {
alert("<font id="wordhighlight_id4" class="wordhighlight_ext wordhighlight_word2" name="wordhighlight_word2">火狐</font>浏览器");
}else if($.browser.safari) {
alert("safari浏览器");
@suxiaogang
suxiaogang / Yin-Yang Puzzle.scm
Last active August 29, 2015 13:58
Yin-Yang Puzzle in Scheme
(let*
(
(yin
((lambda (cc) (display #\@) cc) (call-with-current-continuation (lambda (c) c))))
(yang
((lambda (cc) (display #\*) cc) (call-with-current-continuation (lambda (c) c))))
)
(yin yang))