Skip to content

Instantly share code, notes, and snippets.

@JiboStore
JiboStore / gist:f6274288e829a9821a115019fcc6674f
Created Jun 4, 2018
Source Tree Commit Info Panel Gone
View gist:f6274288e829a9821a115019fcc6674f
Fix for source tree commit information window gone:
defaults delete com.torusknot.SourceTreeNotMAS "NSSplitView Subview Frames repowindow_LogViewDescSplitter"
https://community.atlassian.com/t5/Sourcetree-questions/SourceTree-how-to-show-commit-information-panel/qaq-p/245922
View backup-git-repos.sh
for DIRECTORY in */;
do
pushd "${DIRECTORY}"
echo "${DIRECTORY}" >> ../git-remote.txt
echo "===================================================================" >> ../git-remote.txt
git remote -v >> ../git-remote.txt
echo "-------------------------------------------------------------------" >> ../git-remote.txt
git log -1 >> ../git-remote.txt
popd
done
View git_important_links
View ios_receipt_verify_the_curl_command
Getting Apple's receipt in iOS 8 onwards:
NSURL *receiptUrl = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *receiptData = [NSData dataWithContentsOfURL:receiptUrl];
// receiptData = [GTMBase64 encodeData:receiptData];
// NSString *receiptString = [[NSString alloc] initWithData:receiptData encoding:NSUTF8StringEncoding];
NSString *receiptString = [receiptData base64EncodedStringWithOptions:0];
NSString *appleJson = [NSString stringWithFormat:@"{ \"receipt-data\" : \"%@\" }", receiptString];
NSLog(@"%@", appleJson);
The receipt:
View gitdiff-svnpatch.sh
git diff --no-prefix --ignore-space-at-eol | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" > changes.patch
@JiboStore
JiboStore / gist:dfe0fdfbd8f7de6f0af7
Created Jul 15, 2015
that'll auto serialise all your changed prefabs (ie write to disk) anytime you play or build
View gist:dfe0fdfbd8f7de6f0af7
using UnityEditor;
using UnityEditor.Callbacks;
public class AutoSerialiseAssets : Editor {
[PostProcessScene(-2)]
public static void OnPostprocessScene() {
EditorApplication.SaveAssets();
}
}
@JiboStore
JiboStore / openssl_genrsa
Created Apr 22, 2014
GENERATE PUBLIC/PRIVATE KEY PAIR:
View openssl_genrsa
GENERATE PUBLIC/PRIVATE KEY PAIR:
For PHP:
openssl genrsa > drmsign.pem
openssl rsa -in drmsign.pem -pubout > drmsign.pub
Then convert to DER (required by Java):
http://codeartisan.blogspot.sg/2009/05/public-key-cryptography-in-java.html
openssl pkcs8 -topk8 -inform PEM -outform DER -in drmsign.pem -out drmsign.der -nocrypt
openssl rsa -in drmsign.pem -pubout -outform DER -out drmsign_pub.der
@JiboStore
JiboStore / Facebook SDK Android Graph API Request
Created Jun 7, 2013
Facebook SDK Android Graph API Request
View Facebook SDK Android Graph API Request
Bundle params = new Bundle();
params.putString( "fields", "fields=id,username,name,first_name,last_name,picture" );
final Request request = new Request( Session.getActiveSession(), "me", params, HttpMethod.GET, new Request.Callback() {
@Override
public void onCompleted(Response response) {
Log.d( "FacebookConnect", "FacebookConnect > retrieveUserData responds: " + response.toString() );
Log.d( "FacebookConnect", "FacebookConnect > retrieveUserData graphObject: " + response.getGraphObject() );
Log.d( "FacebookConnect", "FacebookConnect > retrieveUserData graphObjectList: " + response.getGraphObjectList() );
}
@JiboStore
JiboStore / gist:5693636
Created Jun 2, 2013
Thuzi / facebook-node-sdk error log: #issue41
View gist:5693636
access_token = CAAB2dKc4ZCMEBAAn2vCajKjEJUK5DGQ2urcUIij2wtLbvg6fmbUmEQW4YKxj5QZAemDyx8yLXKyLlZBcZBAeUMIhFUzmul8G45k5h0hBZCu3R07tCZC4QZBQRElACOKYh48CDUodIA4P7t4HITHvwgZC
{ error:
{ message: 'An unknown error has occurred.',
type: 'OAuthException',
code: 1 } }
JSON Stringify: {"error":{"message":"An unknown error has occurred.","type":"OAuthException","code":1}}
POST /announce 500 452ms - 486
{ meal: 'http://nodescrumptious.azurewebsites.net/meals/cheeseburger',
place: '361771023937832',
tags: '510683132',
@JiboStore
JiboStore / gist:4489778
Created Jan 9, 2013
Remove all .DS_Store recursively
View gist:4489778
alias rmdsstores='find ./ -type f | grep .DS_Store | xargs rm'