This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#toggle OSX Finder setting to show the hidden dotfiles | |
if [ `defaults read com.apple.finder AppleShowAllFiles` -eq 1 ]; then | |
defaults write com.apple.finder AppleShowAllFiles -bool NO; | |
else | |
defaults write com.apple.finder AppleShowAllFiles -bool YES; | |
fi | |
killall Finder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean canRespondToIntent(Context ctx, Intent i) { | |
PackageManager pm = ctx.getPackageManager(); | |
List<ResolveInfo> l = pm.queryIntentActivities(i, PackageManager.MATCH_DEFAULT_ONLY); | |
if (l.size()>0) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.media.MediaPlayer; | |
public class PlayerExample { | |
MediaPlayer p = null; | |
private void playSound(String fileName) { | |
p = new MediaPlayer(); | |
try { | |
AssetFileDescriptor afd = ctx.getAssets().openFd(fileName); | |
p.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); | |
afd.close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PhonegapWithAdmobActivity extends DroidGap { | |
private AdView adView; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
adView = new AdView(this, AdSize.BANNER, PUBLISHER_ID); | |
super.loadUrl("file:///android_asset/www/index.html"); | |
((LinearLayout)appView.getParent()).addView(adView); | |
adView.loadAd(new AdRequest()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ keytool -genkey -alias ALIAS_NAME -keypass PASSWORD -keystore PATH_TO_KEYSTORE -validity DAYS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1. removing sing from Android apk in the current directory/カレントディレクトリのapkから署名を削除する | |
find . -name '*.apk' -exec zip -d {} 'META-INF*' \; | |
#2. signing Android apk in the current directory/カレントディレクトリのapkに署名をする | |
find . -name '*.apk' -exec jarsigner -verbose -keystore KEYSTORE_PATH -storepass KEYSTORE_PASSPHRASE {} ALIAS_NAME -keypass ALIAS_PASS \; | |
#3. verifiyng signs/カレントディレクトリのapkの署名を検証する | |
find . -name '*.apk' -exec jarsigner -verify \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. removing sing from Android apk in the current directory/カレントディレクトリのapkから署名を削除する | |
find . -name '*.apk' -exec zip -d {} 'META-INF*' \; | |
2. signing Android apk in the current directory/カレントディレクトリのapkに署名をする | |
find . -name '*.apk' -exec jarsigner -verbose -keystore KEYSTORE_PATH -storepass KEYSTORE_PASSPHRASE {} ALIAS_NAME -keypass ALIAS_PASS \; | |
3. verifiyng signs/カレントディレクトリのapkの署名を検証する | |
find . -name '*.apk' -exec jarsigner -verify \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pymongo | |
git+http://github.com/django-nonrel/mongodb-engine.git#egg=django_mongodb_engine | |
hg+http://bitbucket.org/wkornewald/django-nonrel#egg=Django | |
hg+http://bitbucket.org/wkornewald/djangotoolbox#egg=djangotoolbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int getVersionCode() { | |
int versionCode; | |
try { | |
PackageInfo pinfo = getPackageManager().getPackageInfo(getPackageName(), 0); | |
versionCode = pinfo.versionCode; | |
} catch (NameNotFoundException e) { | |
versionCode = -1; | |
} | |
return versionCode; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<ResolveInfo> getLauncheableActivityList(PackageManager packageManager) { | |
Intent intent = new Intent(Intent.ACTION_MAIN, null); | |
intent.addCategory(Intent.CATEGORY_LAUNCHER); | |
List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(intent, 0); | |
return resolveInfoList; | |
} |