Menu Home

Mac Git Auto Completion Script

1. Checkout Script git clone [email protected]:lnmcc/git-completion.git 2. Put the script into home directory cp -av .git-completion.bash ~/ 3. Edit ~/.profile # GIT Settings source ~/.git-completion.bash 4. Export new env settings source ~/.profile Done !

FileName Checker

/* A-Za-z0-9_- */ static int safe_filename(const char *f) { const char *start = f; for (; *f; f++) { if (!((unsigned)((*f | 32) – ‘a’) < 26 || (unsigned)(*f - '0') < 10 || *f == '_' || *f == '-')) { if (f == start) return 0; else if […]

Android:Get Certificate SHA1 with JNI

#include <assert.h> #include <string.h> #include <stdio.h> #include <android/log.h> const char HexCode[]={‘0′,’1′,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9′,’A’,’B’,’C’,’D’,’E’,’F’}; static void byte_array_to_hex_string(JNIEnv *env, const jbyteArray array, const jsize array_size, char *hex_string) { jbyte *sha1 = (*env)->GetByteArrayElements(env, array, NULL); for (int i = 0; i < array_size; i++) { hex_string[i * 2] = HexCode[((unsigned char)sha1[i]) / 16]; hex_string[i * […]

iOS:How to get your framework version using code

Add these lines in your Framework header file. eg. PrefixFramework.h //! Project version number for LocalSearch. FOUNDATION_EXPORT double PrefixFrameworkVersionNumber; //! Project version string for LocalSearch. FOUNDATION_EXPORT const unsigned char PrefixFrameworkVersionString[]; There arguments will be filled by iOS framework logic.And you can get the version like this: +(NSString*) playerVersion { NSRange […]