Skip to content

Instantly share code, notes, and snippets.

View shikajiro's full-sized avatar

shikajiro shikajiro

View GitHub Profile
@shikajiro
shikajiro / build.gradle
Created February 16, 2015 15:09
Android新規プロジェクト時のbuild.gradleのテンプレート
//build.gradleのテンプレート
/*root*/
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { url 'http://download.crashlytics.com/maven' }
}
#macとRaspberryPiを有線LANで直接繋いだ時に、RaspPi側のipaddressを知るのに素敵なコマンド
sudo tcpdump | grep "192.168.2.*"
@shikajiro
shikajiro / svg2png.groovy
Last active October 27, 2015 07:07
Android用のpng画像生成スクリプト。svg画像をmdpi, hdpi, xhdpi, xxhdpi, xxxhdpi毎のpng画像に変換する。要Inkscape
/* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
weight = 9.5 # your dog weight
isCastration = True # your dog coefficient
coefficient = 1.8
if isCastration:
coefficient = 1.6
calorie = coefficient * (30 * weight + 70)
print calorie
echo "start adb shell capture"
DATE=$(date +%Y%m%d%H%M%S)
FILENAME=${DATE}.mp4
DROPBOX_ID=******
adb shell screenrecord --verbose --time-limit 5 /sdcard/demo.mp4
adb pull /sdcard/demo.mp4 ~/Dropbox/Public/capture/${FILENAME}
adb shell rm /sdcard/temp.png
DROPBOX_URL=https://dl.dropboxusercontent.com/u/${DROPBOX_ID}/capture/${FILENAME}
@shikajiro
shikajiro / backlog2gitlab.py
Created September 9, 2016 00:29
backlogが出力したcsvファイルをgitlabに登録するスクリプト
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
backlogが出力したcsvファイルをgitlabに登録するスクリプト
user_id は予め登録しておく必要があります。
users に追記してください。
gitlabのtokenは暫定で特定ユーザーのものを利用しています。
@shikajiro
shikajiro / fabfile.py
Last active November 28, 2016 10:14
Script to perform the build of Android on another machine
# Script Name : fabfile.py
# Author : shikajiro
# Created : 2016-11-03
# Last Modified : 2016-11-21
# Version : 1.1.0
# Modifications :
# Description :
# Script to perform the build of Android on another machine
# By performing such a build of severely time on another machine,
# it is possible to ensure the CPU resources of the development machine,
@shikajiro
shikajiro / rename_png.sh
Created March 22, 2017 01:30
iOSの@2xが書かれた画像から@2xを消すだけ
rename 's/\@2x//' *
@shikajiro
shikajiro / fb_image_download_selenium.py
Created April 25, 2017 15:01
facebookのグループの写真全てを順番にダウンロードしていく
# coding=utf-8
import time
from selenium import webdriver
if __name__ == '__main__':
try:
browser = webdriver.Chrome('./chromedriver')
@shikajiro
shikajiro / autoshell
Last active April 29, 2017 12:04
bashでディレクトリ移動した時に `.start.sh` が存在したらそれを実行する。.bashrcに追加する
autoshell(){
[[ -n $AUTOLS_DIR ]] && [[ $AUTOLS_DIR != $PWD ]] && [ -e ./.start.sh ] && ./.start.sh
AUTOLS_DIR="${PWD}"
}
PROMPT_COMMAND="autoshell"