Skip to content

Instantly share code, notes, and snippets.

@Inlustra
Inlustra / .zshrc
Last active February 20, 2018 16:05
Antigen ZSHRC
source /usr/local/share/antigen/antigen.zsh
antigen use oh-my-zsh
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-completions
antigen bundle git
antigen bundle lukechilds/zsh-nvm
antigen bundle zpm-zsh/autoenv
# Usage: copyFromRemote <SSH Config Host> <remote file/dir> <local file/dir>
# Example: copyFromRemote myServer ~/remote/path ~/local/path
function copyFromRemote() {
rsync -avze ssh $1:$2 $3
}
# Usage: copyToRemote <SSH Config Host> <local file/dir> <remote file/dir>
# Example: copyToRemote myServer ~/local/path ~/remote/path
function copyToRemote() {
@Inlustra
Inlustra / .zshrc
Last active November 20, 2017 11:39
.zshrc
source /usr/share/zsh-antigen/antigen.zsh
antigen use oh-my-zsh
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle git
antigen bundle zsh-users/zsh-completions
antigen bundle lukechilds/zsh-nvm
antigen bundle zpm-zsh/autoenv
@Inlustra
Inlustra / killport.sh
Created June 14, 2016 10:20
Ubuntu 16.04: Kill application running on port script
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Please supply a port number: 'killport 9000'"
exit 1
fi
sudo kill `sudo lsof -t -i:$1`
//Simple HSL Manipulation
/**
*
*
*
* Author: Thomas Nairn
*
*
*
*/
@Inlustra
Inlustra / ArgumentParser.java
Last active August 29, 2015 14:27
Use Java to mimic the average bash commands with a dash
import java.util.HashMap;
import java.util.Map;
/**
*
* @author thomas
*/
public class ArgumentParser {
private static final Map<String, RunnableParam> arguments = new HashMap<>();
public boolean isInRegion(SimpleLocation location) {
if (location == null)
return false;
SimpleLocation lastPoint = area.get(area.size() - 1);
boolean isInside = false;
double x = location.getLongitude();
for (SimpleLocation point : area) {
double x1 = lastPoint.getLongitude();
double x2 = point.getLongitude();
double dx = x2 - x1;