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 / workspace.isTreeLocked.java
Created July 23, 2013 08:18
workspace.isTreeLocked
final Workspace workspace = (Workspace) ResourcesPlugin.getWorkspace();
if (workspace.isTreeLocked()) {
workspace.setTreeLocked(false);
}
final IResourceDelta delta2 = delta;
final IProject project2 = project;
Job saveTarget = new Job(ICommonConstants.EMPTY_STRING) {
@Override
protected IStatus run(IProgressMonitor monitor) {
@suxiaogang
suxiaogang / douban_baidupan_inject.js
Created September 7, 2013 10:30
douban_baidupan_inject.js
//条目的讨论页面,豆列页面不显示搜索结果
var currentURL = document.URL;
if(currentURL.indexOf('discussion') != -1 || currentURL.indexOf('doulist') != -1 ){
return;
} else {
inject();
}
function inject(){
var title = $('html head title').text();
@suxiaogang
suxiaogang / VM arguments
Created October 25, 2013 02:50
VM arguments for Eclipse application debugging.
-Dosgi.requiredJavaVersion=1.6 -Xms128m -Xmx512m -XX:MaxPermSize=128m -XX:PermSize=80m
@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))
<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 / 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;
@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 / 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",
/**
* 多个数组进行合并
*
* @author Sam Su
* @date 2013-07-12
* @param <T>
* @param first
* @param rest
* @return
*/
@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{