Skip to content

Instantly share code, notes, and snippets.

@premek
premek / mv.sh
Last active Apr 17, 2021
Rename files in linux / bash using mv command without typing the full name two times
View mv.sh
# 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
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 Jun 11, 2021
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel10k

Powerlevel10k

@jvns
jvns / executing-file.md
Last active May 21, 2021
What happens when I run ./hello
View executing-file.md

(You can comment here.)

Here I'm trying to understand what happens when I run

./hello
#include <stdio.h>
@weitsang
weitsang / nus-fyp-presentation-tips.md
Last active Apr 27, 2021
Tips for School of Computing Final Year Project Presentation.
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

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