View mv.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this function to your .bashrc file. | |
# Usage: mv oldfilename | |
# If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
# Original mv is called when it's called with more than one argument. | |
# It's useful when you want to change just a few letters in a long name. | |
# | |
# Also see: | |
# - imv from renameutils | |
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
View restartbuild.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PASSED = 'passed', | |
STARTED = 'started', | |
FAILED = 'failed', | |
ERRORED = 'errored', | |
CANCELED = 'canceled', | |
POLL_PERIOD = 5000, | |
MAX_MINUTES = 22; | |
function icon(which) { |
View executing-file.md
Here I'm trying to understand what happens when I run
./hello
#include
View nus-fyp-presentation-tips.md
FYP Final Presentation
Basic Principles
- Show the examiners, and make them understand, clearly what you have achieved after about 400 hours of work over two semesters.
- Demonstrate to the examiners that you know very well what you have done.
- Keep the examiners happy.
Slides
View dockicon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
Class util = Class.forName("com.apple.eawt.Application"); | |
Method getApplication = util.getMethod("getApplication", new Class[0]); | |
Object application = getApplication.invoke(util); | |
Class params[] = new Class[1]; | |
params[0] = Image.class; | |
Method setDockIconImage = util.getMethod("setDockIconImage", params); | |
URL url = App.class.getClassLoader().getResource("icon.png"); | |
Image image = Toolkit.getDefaultToolkit().getImage(url); | |
setDockIconImage.invoke(application, image); |