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 | |
set -e | |
_xcrun() { | |
DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer \ | |
xcrun -sdk iphonesimulator \ | |
"$@" | |
} |
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
// simple cache implementation provide a key that you're looking for and | |
// a function that will compute the value in case of a cache miss | |
async get (key, expensiveFn) { | |
let result = await storage.get(key) | |
if (result === undefined) { | |
result = await expensiveFn | |
await storage.save(result) | |
} | |
return result | |
} |
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 | |
# ===> Set these variables first | |
branch="$GIT_BRANCH" | |
# Example: "Jaskaranbir/MyRepo" | |
repo_slug="$TRAVIS_REPO_SLUG" | |
token="$GITHUB_TOKEN" | |
version="$TRAVIS_TAG" | |
# An automatic changelog generator |
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
[package] | |
name = "rust_learning" | |
version = "0.1.0" | |
authors = ["Stuart Nelson <[email protected]>"] | |
[dependencies] | |
prometheus = "0.2" |
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
// When you are in the diff page of a GitHub PR | |
// And want to hide all the Pods/* files in that diff page, use this: | |
// Paste that in your Web Inspector's console | |
var nodes = document.evaluate("//div[@class='file-header' and starts-with(@data-path,'Pods/')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); | |
for(i=0; i<nodes.snapshotLength; ++i) { | |
nodes.snapshotItem(i).parentNode.hidden = true | |
} | |
// Or even better, create a bookmark with this code for easy quick access: |
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.util.Base64; | |
import android.util.Log; | |
import com.bugsnag.android.Bugsnag; | |
import com.bugsnag.android.MetaData; | |
import com.bugsnag.android.Severity; | |
import com.facebook.react.bridge.*; | |
import java.io.File; | |
import java.io.InputStream; |
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. Containing app - Store token url in the group user defaults. | |
DBAccount *account = [[DBAccountManager sharedManager] handleOpenURL:url]; | |
if (account) { | |
NSUserDefaults *groupDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.example.app"]; | |
[groupDefaults setObject:url.absoluteString forKey:@"dropbox.token.url"]; | |
[groupDefaults synchronize]; | |
} | |
// 2. An Extension - Retrieve the token url from group user defaults, then give it to -[DBAccountManager handleOpenURL:] after setting "nonce". | |
NSUserDefaults *groupDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.example.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
# ZSH / BASH users | |
# Add this to your .env, .bashrc, .zshrc, or whatever file you're using for environment | |
man() { | |
env \ | |
LESS_TERMCAP_mb=$(printf "\e[1;31m") \ | |
LESS_TERMCAP_md=$(printf "\e[1;31m") \ | |
LESS_TERMCAP_me=$(printf "\e[0m") \ | |
LESS_TERMCAP_se=$(printf "\e[0m") \ | |
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ |
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
/* | |
File: ExceptionTest.c | |
Contains: Test code for Mach exception handling. | |
Written by: DTS | |
Copyright: Copyright (c) 2006 by Apple Computer, Inc., All Rights Reserved. | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. |
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 | |
all_assets=`find $1 -type f | uniq | grep -v @2x` | |
for asset in $all_assets; do | |
name=`basename $asset | cut -d . -f 1` | |
count=`git grep $name | grep -v project.pbxproj: | wc -l` | |
echo -e "$count\t$asset" | |
done |
NewerOlder