Skip to content

Instantly share code, notes, and snippets.

View taketin's full-sized avatar
🍺
cheers

H.Takeshita taketin

🍺
cheers
  • Fukuoka, Japan.
View GitHub Profile
@taketin
taketin / open_in_iterm_current_xcode_project.applescript
Created November 18, 2018 14:28
This script can open current Xcode project's directory in iTerm.
#!/usr/bin/osascript
on run argv
set cmd to "cd" & " \"" & (do shell script "pwd") & "\""
tell application "iTerm"
activate
tell current window
set firstTab to current tab
tell current session of current tab
write text cmd

Swift Style Guide from github.com

スペーシング

  • スペースではなくタブを使う。
  • ファイルの終端は改行を入れる。
  • 論理的なまとまりにコードを分割するための改行は自由に使って良い。
  • 末尾に空白を入れない。
@taketin
taketin / harahe.coffee
Last active August 29, 2015 14:03
Sample Hubot scripts to get data from gurunavi API
# Description:
# Get restaurant data from Gurunavi API
#
# Commands:
# hubot harahe - Reply with restaurant info
Client = require("node-rest-client").Client
client = new Client()
parseString = require('xml2js').parseString
@taketin
taketin / capitalize.js
Created November 20, 2012 07:42
capitalize method
String.prototype.capitalize = function() {
return this.toString().toLowerCase().replace(/\b[a-z]/g, function(letter) {
return letter.toUpperCase();
})
}
@taketin
taketin / css_transformer.rb
Created October 26, 2012 16:47 — forked from avinasha/css_transformer.rb
A Sanitize gem transformer which sanitizes any CSS in a HTML document.
check_css = lambda { |env|
node = env[:node]
node_name = env[:node_name]
# Don't continue if this node is already whitelisted or is not an element.
return if env[:is_whitelisted] || !node.element?
parent = node.parent
return unless node_name == 'style' || node['style']
if node_name == 'style'
unless good_css? node.content
node.unlink
@taketin
taketin / progress-keyframe-anim.html
Created April 2, 2012 17:27
Easy ProgressBar Animation Snipet.
<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>dynamic-keyframe-anim-sanple</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
(function() {
var anim_number = 1;
#!/usr/bin/python
# -*- coding:utf8 -*-
import socket, ssl
network = '' #host
port = 6668
# 以下変数を編集して使ってください -------------------------------------------#
@taketin
taketin / MyDelegateClass.h
Created September 7, 2011 06:52
Objective-C Protocol Template
/**
* MyDelegateClass.h
*/
#import <Foundation/Foundation.h>
@protocol MyDelegate;
@interface MyDelegateClass : NSObject {
id <MyDelegate>_delegate;
}