Skip to content

Instantly share code, notes, and snippets.

View aagontuk's full-sized avatar

Ashfaqur Rahaman aagontuk

View GitHub Profile
@aagontuk
aagontuk / ls-clone-attempt.c
Created June 17, 2016 10:15
My Unix ls command clone attempt
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <time.h>
#include <string.h>
/* Serial Port Programming
* Base on the tutorial from
* http://xanthium.in/Serial-Port-Programming-on-Linux
*/
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <errno.h>
@aagontuk
aagontuk / digitrec.py
Last active December 12, 2017 10:49
Canny edge detection
import cv2
import numpy as np
img = cv2.imread(example.jpg)
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
blurred = cv2.GaussianBlur(imgGray, (5, 5), 0)
imgCanny = cv2.Canny(blurred, 50, 80)
cv2.namedWindow('Canny Edge', cv2.WINDOW_NORMAL)
@aagontuk
aagontuk / save_universe.py
Created April 9, 2018 19:13
Saving the universe again - cj2018 problem 1
def flip(s):
sz = len(s)
flip = 0
for i in xrange(0, sz - 1):
if s[i] == 'C' and s[i + 1] == 'S':
s[i], s[i + 1] = 'S', 'C'
flip = 1
break
@aagontuk
aagontuk / save_universe.py
Created April 9, 2018 19:13
Saving the universe again - cj2018 problem 1
def flip(s):
sz = len(s)
flip = 0
for i in xrange(0, sz - 1):
if s[i] == 'C' and s[i + 1] == 'S':
s[i], s[i + 1] = 'S', 'C'
flip = 1
break
@aagontuk
aagontuk / .zshrc
Last active November 25, 2019 09:20
My ~/.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/sfinix/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@aagontuk
aagontuk / .vimrc
Last active January 27, 2020 08:28
My ~/.vimrc - RAW: tiny.cc/sfinix-vim
" required for Vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'ajmwagar/vim-deus'
@aagontuk
aagontuk / .tmux.conf
Last active February 2, 2020 12:37
My tmux configuration - RAW: tiny.cc/sfinix-tmux
# Remap prefix from c-b to c-space
unbind C-b
set-option -g prefix C-Space
bind-key C-Space send-prefix
# Open tmux config file in vim new window
unbind e
bind e new-window -n '~/.tmux.conf' "sh -c 'vim ~/.tmux.conf' && tmux source ~/.tmux.con"
# Modern colors
@aagontuk
aagontuk / config
Created February 5, 2020 19:44
My i3 configuration file
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
!-------- Xterm Terminal Settings {{{
!------------------------------------------------------
! https://wiki.archlinux.org/index.php/Xterm
! https://lukas.zapletalovi.com/2013/07/hidden-gems-of-xterm.html
! http://www.futurile.net/2016/06/14/xterm-setup-and-truetype-font-configuration/
! http://www.futurile.net/2016/06/15/xterm-256color-themes-molokai-terminal-theme/
! Allow xterm to report the TERM variable correctly.
! Do not set the TERM variable from your ~/.bashrc or ~/.bash_profile or similar file.
! The terminal itself should report the correct TERM to the system so that the proper terminfo file will be used.