Skip to content

Instantly share code, notes, and snippets.

# if run as "tmux attach", create a session if one does not already exist
new-session -n $HOST
# shift arrows for panels
bind -n S-Left select-pane -L
bind -n S-Right select-pane -R
bind -n S-Up select-pane -U
bind -n S-Down select-pane -D
# alt arrows for windows
@Kehet
Kehet / backup.sh
Created May 12, 2017 16:54
Simple dublicity script
#!/bin/bash
export PASSPHRASE=1234
FTP_URL="sftp://user@host:port/file"
BK_FULL_FREQ="1M" # create a new full backup every...
BK_FULL_LIFE="6M" # delete any backup older than this
BK_KEEP_FULL="2" # How many full+inc cycle to keep
function makebackup() {
@Kehet
Kehet / fancytime.php
Last active March 28, 2021 11:53
laravel blade tag for formatting dates. place this into app/Providers/AppServiceProvider.php::boot
<?php
Blade::directive('fancytime', function ($time) {
return "<abbr title=\"<?php echo " . $time . "->format('d.m.Y H:i:s'); ?>\">" .
"<time datetime=\"<?php echo " . $time . "->toIso8601String(); ?>\">" .
"<?php echo " . $time . "->diffForHumans(); ?>" .
"</time>" .
"</abbr>";
});
@Kehet
Kehet / command.sh
Created November 18, 2016 14:47
Disable window alt-dragging in Unity / GNOME
gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"
@Kehet
Kehet / .aliases
Last active February 7, 2018 13:44
My bash aliases
# gnome
alias go='nohup xdg-open 1>/dev/null 2>&1'
# apt
alias sai='sudo apt install'
alias sau='sudo apt update'
alias saa='sudo apt autoremove'
alias sadu='sudo apt dist-upgrade'
alias acs='apt-cache search'
@Kehet
Kehet / mirc.ini
Created August 19, 2014 15:46
Solarized color scheme for mIRC
[colors]
# ...
n5=Solarized,0,15,10,9,8,8,8,15,11,11,15,6,9,9,7,6,15,15,11,11,15,0,6,0,7,7,15,0,0,15
[palettes]
# ...
n5=3552822,4342338,7695960,8616805,9868419,10592659,14018798,14939901,35253,1461195,3093212,8533715,12874092,13798182,10002730,39301
@Kehet
Kehet / export.lua
Created August 17, 2014 23:29
World of Warcrafts Dungeon Journal Exporter to XML (may cause hangout, use with caution)
local flags = {"tank", "dps", "healer", "heroic", "deadly", "important", "interruptible", "magic", "curse", "poison", "disease", "enrage", "enrage"}
local EJ_DIFF_N = 1
local EJ_DIFF_HC = 2
local EJ_DIFF_10 = 3
local EJ_DIFF_25 = 4
local EJ_DIFF_10HC = 5
local EJ_DIFF_25HC = 6
local EJ_DIFF_LFR = 7
local EJ_DIFF_CHA = 8
public double ColourDistance(Color c1, Color c2)
{
double rmean = ( c1.getRed() + c2.getRed() )/2;
int r = c1.getRed() - c2.getRed();
int g = c1.getGreen() - c2.getGreen();
int b = c1.getBlue() - c2.getBlue();
double weightR = 2 + rmean/256;
double weightG = 4.0;
double weightB = 2 + (255-rmean)/256;
return Math.sqrt(weightR*r*r + weightG*g*g + weightB*b*b);
@Kehet
Kehet / ToString.java
Created November 4, 2012 01:32
toString -string formatter
package helpers;
/**
* This class formats general toString -string to more readable form
*
* Usage:
* ToString.print(object);
*
* @author Kehet
*/