Skip to content

Instantly share code, notes, and snippets.

View kaishin-r's full-sized avatar
🎯
Focusing

Kaishin R. kaishin-r

🎯
Focusing
  • Tokyo, Japan
  • 01:23 (UTC +09:00)
View GitHub Profile
@kaishin-r
kaishin-r / MNGExpandedTouchAreaButton.swift
Last active January 27, 2023 16:18 — forked from mingsai/MNGExpandedTouchAreaButton.swift
A Swift UIButton subclass to expand the touch area of the button.
//
// MNGExpandedTouchAreaButton.swift
//
//
// Created by Tommie Carter on 7/7/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@kaishin-r
kaishin-r / GPG-Tower
Created January 10, 2019 07:47 — forked from LeonardoCardoso/GPG-Tower
How to setup Tower to use the GPG Suite
# GPG on Tower
@kaishin-r
kaishin-r / ModelManager.swift
Created May 3, 2016 14:51 — forked from cshimy/ModelManager.swift
Model Manager with Core Data and iCloud Support
//
// ModelManager.swift
// AppName
// Remember to add the iCloud entitlement under the project capabilities
//
import Foundation
import CoreData
let kCoreDataUpdated: String = "coreDataUpdated"
@kaishin-r
kaishin-r / sublime-text-3-cloud-drive-sync
Created February 19, 2016 09:48
Sync Sublime Text 3 Settings via iCloud Drive
# Create a directory named "Sublime Text 3 Sync" under iCloud Drive
mkdir ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync
# Enter Sublime Text 3's directory
cd ~/Library/Application\ Support/Sublime\ Text\ 3/
# Move "Installed Packages" directory to iCloud Drive and make a link
mv Installed\ Packages/ ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync/
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync/Installed\ Packages
@kaishin-r
kaishin-r / mergeContentsOfPath
Created May 15, 2015 08:58
Function of merge directory A to directory B
- (void)mergeContentsOfPath:(NSString *)srcDir intoPath:(NSString *)dstDir withError:(NSError **)error {
NSLog(@"Merge from Dir: %@ to Dir: %@", srcDir, dstDir);
NSString *sourceBasePath = srcDir;
NSString *destBasePath = dstDir;
NSURL *destBaseURL = [NSURL fileURLWithPath:destBasePath];
int subPathIndex = (int)[sourceBasePath length] + 1;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSDirectoryEnumerator *dirEnum = [fileManager enumeratorAtURL:[NSURL fileURLWithPath:sourceBasePath]
includingPropertiesForKeys:[NSArray arrayWithObject:NSURLIsDirectoryKey]
@kaishin-r
kaishin-r / install_irc_server_on_centos6
Last active February 14, 2019 09:00
Install IRC Server on CentOS6
// Setting up an IRC server on Cent 6
// Create a user and group for this guy
$ groupadd ircadmin && useradd -m -g ircadmin -s /bin/bash ircadmin
// Make a working directory (/var/source/)
mkdir source && cd source
// Grab the latest versions of Anope and UnrealIRCd
$ wget http://www.unrealircd.com/downloads/Unreal3.2.9.tar.gz http://downloads.sourceforge.net/project/anope/anope-stable/Anope%201.8.7/anope-1.8.7.tar.gz
@kaishin-r
kaishin-r / install_nginx_on_centos6
Created February 14, 2013 17:12
Install Nginx on CentOS 6 via yum
// uninstall all previous Apache and PHP related RPMs
# yum remove httpd* php*
// enable both repositories
# yum install yum-priorities -y
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# yum install nginx
@kaishin-r
kaishin-r / running_jekyll_on_centos_5
Created December 18, 2012 13:12
Running Jekyll on CentOS 5.6
yum install rdoc ri zlib zlib-devel
yum install ruby-devel
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar -zxvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
ruby setup.rb
gem install jekyll
Results in:
===========