Skip to content

Instantly share code, notes, and snippets.

View shohei's full-sized avatar

Shohei Aoki shohei

View GitHub Profile
@shohei
shohei / shrink-git-repo.sh
Created June 15, 2016 02:20 — forked from aaronzirbes/shrink-git-repo.sh
This script will help you remove large files from your git repo history and shrink the size of your repository.
#!/bin/bash
echo "Finding and Purging Big Files From Git History"
echo "=============================================="
echo ""
echo "http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history/"
echo ""
pushd "$(git rev-parse --show-toplevel)" > /dev/null

Last updated: 2015-08-11

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@shohei
shohei / AddCookiesInterceptor.java
Created June 12, 2017 04:33 — forked from nikhiljha/AddCookiesInterceptor.java
Retrofit2/OkHttp3 Cookies (Drag and Drop, One Size Fits 99%)
// Original written by tsuharesu
// Adapted to create a "drop it in and watch it work" approach by Nikhil Jha.
// Just add your package statement and drop it in the folder with all your other classes.
import android.content.Context;
import android.preference.PreferenceManager;
import android.util.Log;
import java.io.IOException;
import java.util.HashSet;
@shohei
shohei / gist:209d395c9ce81211c863e25818326fb3
Created June 12, 2017 09:28 — forked from acwright/gist:1944639
Sinatra / ActionMailer / Sendgrid / Heroku
require 'sinatra'
require 'action_mailer'
class Mailer < ActionMailer::Base
def contact
mail(
:to => "test@example.com",
:from => "test@example.com",
:subject => "Test") do |format|
format.text
@shohei
shohei / FIR Acceleration on PYNQ.ipynb
Created March 22, 2018 07:08 — forked from fpgadeveloper/FIR Acceleration on PYNQ.ipynb
How to accelerate a Python function with PYNQ
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
################################################################
# This is a generated script based on design: streams_example
#
# Though there are limitations about the generated script,
# the main purpose of this utility is to make learning
# IP Integrator Tcl commands easier.
################################################################
namespace eval _tcl {
@shohei
shohei / rocket_sizing.py
Created July 28, 2019 14:56 — forked from ina111/rocket_sizing.py
多段ロケットの最適質量配分(サイジング)問題の計算
# -*- coding: utf-8 -*-
# ======
# 多段ロケットの最適質量配分(サイジング)問題の計算
# 必要な軌道速度に空力損失、重力損失、推力損失、制御損失を追加し、
# トータルの⊿Vを事前に算出し、その軌道速度に必要なサイジングを行う。
# 初期検討段階にのみ使用可能。
#
# 入力:
# 各段のIsp[秒]
# 各段の構造比(0.0~1.0)(各段の全備重量と推進剤以外の割合)