Skip to content

Instantly share code, notes, and snippets.

@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# 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)
var PASSED = 'passed',
STARTED = 'started',
FAILED = 'failed',
ERRORED = 'errored',
CANCELED = 'canceled',
POLL_PERIOD = 5000,
MAX_MINUTES = 22;
function icon(which) {
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active October 11, 2024 01:06
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@jvns
jvns / executing-file.md
Last active August 30, 2024 17:24
What happens when I run ./hello
@weitsang
weitsang / nus-fyp-presentation-tips.md
Last active March 4, 2023 00:54
Tips for School of Computing Final Year Project Presentation.

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

@bchapuis
bchapuis / dockicon.java
Created January 4, 2012 21:59
Mac osx java application dock icon
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);