Skip to content

Instantly share code, notes, and snippets.

View iiey's full-sized avatar

nemo iiey

View GitHub Profile
@iiey
iiey / git-completion.bash
Last active October 6, 2017 18:12
linux bash completion for non standard programs
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@iiey
iiey / dev.yaml
Last active July 28, 2022 12:27
my tmux sessions. Put these in ~/.tmuxp. For info see project: https://github.com/tony/tmuxp
session_name: dev
windows:
- window_name: code
start_directory: ~/proj/code
focus: true
panes:
- shell_command:
- '[ -d ~/src/dict/computer ] && fortune ~/src/dict/computer || fortune -s'
- window_name: build
@iiey
iiey / configure_vim
Last active June 30, 2022 14:48
install vim from source (get dependencies and configure features)
#!/bin/bash
##UNINSTALL
#sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
##Optional: so vim can be uninstalled again via `dpkg -r vim`
#sudo apt-get install checkinstall
#sudo rm -rf /usr/local/share/vim /usr/bin/vim
##INSTALL
@iiey
iiey / getopt_long_example.cpp
Created May 2, 2018 09:50 — forked from ashwin/getopt_long_example.cpp
How to parse options in C++ using getopt_long
#include <getopt.h>
#include <iostream>
int num = -1;
bool is_beep = false;
float sigma = 2.034;
std::string write_file = "default_file.txt";
void PrintHelp()
{
@iiey
iiey / README.md
Last active August 23, 2024 08:16
fortunes files

fortune

  • Generate database file:
# combine multiple files into one
cat computer vimtips > quotes
# create random access file
strfile quotes quotes.dat
@iiey
iiey / readme
Created November 13, 2018 09:35
vim thesaurus dictionaries
1. Save files to ~/.vim/dict
2. Add to ~/.vimrc:
"THESAURUS
"Add personal synonym files
if !empty(glob("~/.vim/dict"))
set thesaurus+=~/.vim/dict/thesaurus-vim-en
set thesaurus+=~/.vim/dict/thesaurus-vim-de
endif
@iiey
iiey / cleanup_hist.sh
Created December 27, 2018 09:22
cleanup ~/.bash_history by removing repeated entries from top to bottom
#!/bin/bash
#@brief: shorten ~/.bash_history by removing repeated entries from top to bottom (keep last)
#this additionaly cleanup because below setting not work properly
#HISTCONTROL=ignoreboth:erasedups #ignoreboth(^space and consecutive duplicates), remove duplicates
#@note: this script not work with HISTTIMEFORMAT enable (command with timestamp)
#declare filepath
HIST=$HOME/.bash_history
TEMP=/tmp/tmp_hist
@iiey
iiey / basic_classification.ipynb
Created January 3, 2019 07:58
basic_classification.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iiey
iiey / accuweather_location_codes.txt
Created May 8, 2019 07:37
location codes for accuweather
City Name = "Aachen, DE" Location = "EUR|DE|GM011|AACHEN" Country = "Germany"
City Name = "Aalborg, DK" Location = "EUR|DK|DA007|AALBORG" Country = "Denmark"
City Name = "Aalesund, NO" Location = "EUR|NO|NO007|AALESUND" Country = "Norway"
City Name = "Aare, SE" Location = "EUR|SE|SW006|AARE" Country = "Sweden"
City Name = "Aarhus, DK" Location = "EUR|DK|DA001|AARHUS" Country = "Denmark"
City Name = "Aba, NG" Location = "AFR|NG|NI008|ABA" Country = "Nigeria"
City Name = "Abadan, IR" Location = "MEA|IR|IR016|ABADAN" Country = "Iran"
City Name = "Abakan, RU" Location = "ASI|RU|RS033|ABAKAN" Country = "Russia"
City Name = "Abbotsford, CA" Location = "NAM|CA|BC|ABBOTSFORD" Country = "Canada"
City Name = "Abeokuta, NG" Location = "AFR|NG|NI000|ABEOKUTA" Country = "Nigeria"
@iiey
iiey / createTrackbar.cpp
Created May 28, 2019 09:15
handle static method createTrackbar of opencv
class A
{
public:
void handleTrackbar(int value)
{
// real work here, can use 'this'
}
//workaround not to declare static var used inside
static void onTrackbar(int value, void* ptr)