Skip to content

Instantly share code, notes, and snippets.

Avatar

matsuyoro matsuyoro

View GitHub Profile
View file0.swift
// アプリバージョンをStringで
let version: String! = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as? String
// 指定URLと文字連結
var myUrlStr:String = "http://hooogeee.com?v=" + version
// NSURL型に変換するなら
var myUrl:NSURL = NSURL(string:myUrlStr)!
View file0.swift
var str:NSString = "ABCDEFGHIJKLMNOP"
var pos = NSMakeRange(4,4) // 位置
println(str.stringByReplacingCharactersInRange(pos, withString: "hoge"))
@matsuyoro
matsuyoro / file1.txt
Created Feb 6, 2015
swift 指定の文字列の位置を最後から検索 ref: http://qiita.com/matsuyoro/items/b7146ae0d79abf845989
View file1.txt
pos 9223372036854775807
@matsuyoro
matsuyoro / gist:c53d82017b2763633e5b
Last active Nov 5, 2020
GAS(google app script)で指定ラベルのGmailをslackに通知
View gist:c53d82017b2763633e5b
// slackのwebhook URL
var postUrl = "https://hooks.slack.com/services/xxxxxxxxxxx";
// 通知したいslackのチャネル(部屋)
var postChannel = "#n_app_review";
// 抽出元のGmailのラベル
var checkLabel = "TO_ME";
function myFunction() {
@matsuyoro
matsuyoro / smb.conf
Last active Jun 30, 2018
/etc/samba/smb.conf 指定ディレクトリを指定ユーザーだけsambaでアクセス可能に(Centos6.5+samba3.6)
View smb.conf
[public]
# コメント
comment = Public space
# 共有するディレクトリのパス
path = /var/www/hoge
# guestユーザのアクセスを許可するか
guest ok = no