Skip to content

Instantly share code, notes, and snippets.

View nomadmonad's full-sized avatar

Tsuyoshi Yamamoto nomadmonad

  • Ricoh IT Solutions, Ltd.
View GitHub Profile
@nomadmonad
nomadmonad / file0.txt
Created November 14, 2017 09:33
PlistBuddyでInfo.plistのVersionやBuildを更新する ref: https://qiita.com/nomadmonad/items/717f1e3342315c9190ff
#!/bin/bash
PATH=/usr/libexec:$PATH
if [ $ACTION = "build" ]; then
exit 0
fi
buildNumber=$(PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
@nomadmonad
nomadmonad / file0.py
Created January 28, 2014 14:20
認証付きプロキシの環境でPackage Controlを導入する方法 ref: http://qiita.com/nomadmonad/items/ed172b595bb300727340
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler({"http": "http://[username]:[password]@[proxy_server]:[port]", "https": "https://[username]:[password]@[proxy_address]:[port]"})) ); by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
@nomadmonad
nomadmonad / vcard2csv.rb
Created January 3, 2014 03:26
convert vcard (*.vcf) to csv
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'vpim/vcard'
require 'csv'
dest_file = Dir::pwd + "/addresses.csv"
csv = CSV.open(dest_file, "ab")
ARGV.each do |file|