Skip to content

Instantly share code, notes, and snippets.

@toidiu
toidiu / DatabaseHelper.java
Created March 9, 2015 22:18
ORMLite boilerplate
package co.touchlab.boomset.app.data;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;
import org.jetbrains.annotations.NotNull;
# as
PACKAGENAME = "com.toidiu.app"
COPY_LOCATION = "~/Desktop/db"
adb shell "run-as PACKAGENAME chmod -R 777 /data/data/PACKAGENAME/databases"
adb shell "mkdir -p /sdcard/tempDB"
adb shell "cp -r /data/data/PACKAGENAME/databases/ /sdcard/tempDB/."
adb pull sdcard/tempDB/ COPY_LOCATION
adb shell "rm -r /sdcard/tempDB/*"
pbcopy < ~/.ssh/id_rsa.pub
--This script only works on OS X 10.8; This is due to GUI changes from 10.7 to 10.8
--launches System Preferences to Displays pane
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events"
--This script only works on OS X 10.8; This is due to GUI changes from 10.7 to 10.8
--launches System Preferences to Displays pane
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events"
--This script only works on OS X 10.8; This is due to GUI changes from 10.7 to 10.8
--launches System Preferences to Displays pane
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events"
@toidiu
toidiu / vimrc
Created February 27, 2017 18:56
set nocompatible
execute pathogen#infect()
syntax on
filetype plugin indent on
"Turn on smart indent
""set smartindent
set tabstop=2
set shiftwidth=2
source ~/.bashrc
export PATH=$PATH:~/bin
### brew install bash-completion
### brew tap homebrew/completions
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
[user]
name = toidiu
email = toidiu@protonmail.com
[alias]
br = branch
co = checkout
s = status
==========curl-format.txt==========
n
time_namelookup: %{time_namelookup}n
time_connect: %{time_connect}n
time_appconnect: %{time_appconnect}n
time_pretransfer: %{time_pretransfer}n
time_redirect: %{time_redirect}n
time_starttransfer: %{time_starttransfer}n
----------n
time_total: %{time_total}n