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
adb shell setprop log.tag.SQLiteLog V | |
adb shell setprop log.tag.SQLiteStatements V | |
adb shell stop | |
adb shell start |
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
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { | |
// dark mode | |
console.log('dark mode') | |
} |
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
sudo setsebool httpd_can_network_connect 1 -P |
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
if(buildType == "AppStore") { | |
infoplist { | |
bundleIdentifier = "com.hpe.appstore" | |
} | |
signing { | |
mobileProvisionURI = 'file://' + currentPath + appStoreProfile | |
certificateURI = "file://" + currentPath + appStoreCert | |
certificatePassword = certPassword | |
} |
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
## Put these in your .bash_profile found in your home directory | |
## in the terminal type source ~/.bash_profile to reload your profile to make them immediately usable or close and re-open Terminal | |
# Hide and show hidden files in Finder windows | |
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app' | |
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app' |
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 Foundation | |
//You have to create a bridging header in your project containing: | |
// #import <CommonCrypto/CommonHMAC.h> | |
extension String { | |
func digestHMac256(key: String) -> String! { | |
let str = self.cStringUsingEncoding(NSUTF8StringEncoding) |
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
/// <SUMMARY> | |
/// Takes a string that represents an enum member | |
/// and returns the enum member | |
/// </SUMMARY> | |
/// <TYPEPARAM name="T">An Enum</TYPEPARAM> | |
/// <PARAM name="input">The string that is the enum member name, case does not matter</PARAM> | |
/// <PARAM name="returnValue">The value from the enum that matches the string, or the first value of the enum</PARAM> | |
/// <RETURNS>True when there is a match, false when not </RETURNS> | |
/// <REMARKS> | |
/// - When no match the first item in the enum is returned |
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 -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -v -list |
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
@SuppressWarnings("deprecation") | |
public class Settings extends PreferenceActivity { | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB ) | |
addPreferencesFromResource(R.xml.settings); | |
else | |
addPreferencesAPIv11(); |
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
/* | |
* Handles Gingerbread crash due to implementation change | |
*/ | |
private static Point getDisplaySize(final Display display) { | |
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { | |
return APIv11.getDisplaySize(display); | |
} else { | |
final Point point = new Point(); | |
point.x = display.getWidth(); |
NewerOlder