Skip to content

Instantly share code, notes, and snippets.

Avatar

mikesorae mikesorae

View GitHub Profile
@mikesorae
mikesorae / convertSheetToJson.js
Created Oct 21, 2015
simply convert a spreadsheet to an array of Json
View convertSheetToJson.js
function convertSheetToJson(sheet) {
var titleRange = sheet.getRange(1, 1, 1, sheet.getLastColumn());
var titles = titleRange.getValues()[0];
var rowRange = sheet.getRange(2, 1, sheet.getLastRow(), sheet.getLastColumn());
var rows = rowRange.getValues();
// create json
var result = [];
for(var i = 0; i < rows.length; i++) {
@mikesorae
mikesorae / append_new_uuid.sh
Last active Oct 18, 2015
add DVTPlugInCompatibilityUUID into plugin's Info.plist when xcode is updated.
View append_new_uuid.sh
# get latest DVTPlugInCompatibilityUUID from your Xcode.app and append it into plugin's info plist
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist | xargs -IFILE defaults write FILE DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
@mikesorae
mikesorae / Vagrantfile
Last active Feb 16, 2017
ansible file for dynamodb server
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@mikesorae
mikesorae / 1_my_fist_gas.js
Last active Oct 30, 2015
For Google Apps Script Hands-on
View 1_my_fist_gas.js
// 1. 初めてのGAS
// メッセージボックスにHello, Worldを表示します。
function myFirstGAS() {
Browser.msgBox('Hello World!');
Logger.log('Hello World!');
}
// シートから値を取得して表示します。
function getValueFromSheet() {
var book = SpreadsheetApp.getActive();
View gist:ec8db8fa37e361a1f64e
# merge into BASE
git checkout "$DEVELOP_BRANCH"
if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then
git merge --ff "$BRANCH"
else
git merge --no-ff "$BRANCH"
fi
@mikesorae
mikesorae / gist:72cbc3df91152ee61133
Last active Aug 29, 2015
file upload by curl & send message to chatwork
View gist:72cbc3df91152ee61133
#!/bin/sh
curl -T "$FILE_NAME" -u $USER:$PASS "https://$SPACE.backlog.jp/dav/$PROJECT/$DIR"
curl -X POST -H "X-ChatWorkToken: $API_TOKEN" -d "body=$MESSAGE" "https://api.chatwork.com/v1/rooms/$ROOM_ID/messages"
@mikesorae
mikesorae / asicon.sh
Last active Aug 29, 2015 — forked from lexrus/asicon.sh
generate app icons of all sizes.
View asicon.sh
#!/bin/bash
# According to https://developer.apple.com/library/ios/#qa/qa1686/_index.html
# Install ImageMagick with MacPort: sudo port install ImageMagick
convert $1 -resize 512x512 iTunesArtwork.png # Ad Hoc iTunes
convert $1 -resize 60x60 Icon.png # Home screen on non-Retina
convert $1 -resize 120x120 Icon@2x.png # Home screen for Retina display
convert $1 -resize 180x180 Icon@3x.png # Home screen for Retina display(iPhone6+)
convert $1 -resize 76x76 Icon-ipad.png # Home screen on iPad
convert $1 -resize 152x152 Icon-ipad@2x.png # Home screen on iPad Retina
convert $1 -resize 40x40 Icon-spotlight.png # Spotlight icon for non-Retina display
View gist:3af1fa5ea0c5d882a1e2
nokogiri ${FILE_NAME} -e 'puts $_.css("body").to_s' | html2slim
@mikesorae
mikesorae / app_build.gradle
Created Jan 26, 2015
gradle script for android using android-annotations and active-android
View app_build.gradle
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AndroidAnnotationsVersion = '3.2'
android {
compileSdkVersion 21
buildToolsVersion "21.0.2"
defaultConfig {
applicationId "com.example.app_name"
@mikesorae
mikesorae / apk-util
Last active Aug 29, 2015
apk utilityコマンドになる予定
View apk-util
#!/bin/bash
echo apk-util v0.0.1
package-name() {
aapt dump badging $1 | grep "package: name" | sed "s/[^']*'\([^']*\)'.*/\1/"
}
uninstall() {
adb uninstall `package-name $1`