Skip to content

Instantly share code, notes, and snippets.

View jeepkd's full-sized avatar

Nutthawut (Jeep) Kiddee jeepkd

View GitHub Profile
@jeepkd
jeepkd / .vimrc
Last active August 29, 2015 14:16
Jeep's .vimrc
set shell=/bin/bash
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " required
Plugin 'bling/vim-airline'
@jeepkd
jeepkd / Gemfile
Last active December 25, 2015 17:00
Quick ruby script to back up tagged facebook photos
source 'https://rubygems.org'
gem 'koala'
gem 'awesome_print'
gem 'mini_exiftool'
@jeepkd
jeepkd / MyTabBar.m
Created March 1, 2016 18:17
Resize UITabBar
@implementation MyTabBar
-(CGSize)sizeThatFits:(CGSize)size
{
CGSize sizeThatFits = [super sizeThatFits:size];
sizeThatFits.height = 100;
return sizeThatFits;
}
@jeepkd
jeepkd / _.m
Created March 1, 2016 18:19
Hides UITabBar shadow
[self.tabBar setValue:@(YES) forKeyPath:@"_hidesShadow"];
@jeepkd
jeepkd / DynamicBackground.m
Created March 2, 2016 06:02
Dynamic background image from color
CGSize size = CGSizeMake(desiredWidth, desiredHeight);
UIGraphicsBeginImageContextWithOptions(size, YES, 0);
[[UIColor whiteColor] setFill];
UIRectFill(CGRectMake(0, 0, size.width, size.height));
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
@jeepkd
jeepkd / say_years.py
Created February 16, 2017 07:07
Practice listening to years in english on macOS
from os import system
import random
while True:
answer = ""
question_year = random.randint(1000,2100)
while answer != str(question_year):
system(f"say {question_year}")
answer = input()
# app/helpers/enum_i18n_helper.rb
module EnumI18nHelper
# Returns an array of the possible key/i18n values for the enum
# Example usage:
# enum_options_for_select(User, :approval_state)
def enum_options_for_select(class_name, enum)
class_name.send(enum.to_s.pluralize).map do |key, _|
[enum_i18n(class_name, enum, key), key]
end
@jeepkd
jeepkd / thailand.json
Last active December 15, 2023 14:29
Simplified GeoJson for provinces of Thailand. Including new province Bueng Kan.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#%%
import glob
import numpy as np
import pandas as pd
import exifread
import imagehash
import IPython.display
from PIL import Image
from datetime import datetime
set -g mouse on
setw -g mode-keys vi
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"