Skip to content

Instantly share code, notes, and snippets.

Jumpei Katayama jkatayama

Block or report user

Report or block jkatayama

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jkatayama
jkatayama / 0_reuse_code.js
Created May 22, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jkatayama
jkatayama / Gemfile
Created May 19, 2017
Gemfile for iOS project
View Gemfile
# Gemfile for iOS project
source "https://rubygems.org"
gem 'cocoapods'
# Folder reorganizer
gem 'synx'
# Task Automation
gem 'fastlane'
View git-command.md

git-nuke multiple feature branches

for i in {1..10}\ndo\ngit-nuke feature/\#${i}\ndone
@jkatayama
jkatayama / mac_command.md
Last active May 29, 2017
Max and Unixコマンド
View mac_command.md

Show all download url

sudo sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | more

quicklook files or directories with preview

qlmanage -p
View keybase.md

Keybase proof

I hereby claim:

  • I am jkatayama on github.
  • I am jkatayama (https://keybase.io/jkatayama) on keybase.
  • I have a public key ASDVU4uE8Cs5l6YKnmXN4R2X2XnblcJq4vncMIUvRscfuQo

To claim this, I am signing this object:

View calendar_objc.md

##calendar.h

#import <Foundation/Foundation.h>


@interface myCalender : NSObject{
    NSCalendar  *gcal;
    NSInteger   year;
    NSInteger   month;
}
View useful function for math
### 二つの点の距離
``` swift
func distance(pointA: CGPoint, pontB: CGPoint) -> Float {
let dx: Float = abs(pointA.x - pontB.x)
let dy: Float = abs(pointA.y - pontB.y)
let dist = sqrt(dx*dx + dy*dy)
return dist
}
View iOS sheat-sheet.md

iOS sheat-sheet

Get a selected cell's index

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    let path = self.tableView.indexPathForSelectedRow
    segue.destinationViewController.detail = self.detailForIndexPath(path)
}
View ios9_improvement.md

iOS9 improvement

Disblae ATS(AppTransportSecurity) to allow http

<key>NSAppTransportSecurity</key>
     <dict>
         <key>NSAllowsArbitraryLoads</key><true/>
     </dict>
@jkatayama
jkatayama / which_and_go.sh
Created Feb 17, 2016
go to the directory in which your command exists
View which_and_go.sh
cd $(dirname "$(which npm)")
You can’t perform that action at this time.