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
android.applicationVariants.all { variant -> | |
if (variant.getBuildType().name == "debug") { | |
task "configDevice${variant.name.capitalize()}" (type: Exec){ | |
dependsOn variant.install | |
group = 'nameofyourtaskgroup' | |
description = 'Describe your task here.' | |
def adb = android.getAdbExe().toString() | |
def mypermission = 'android.permission.READ_ACCOUNTS' |
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
[bumpversion] | |
commit = True | |
tag = True | |
current_version = 0.1.0 | |
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))? | |
serialize = | |
{major}.{minor}.{patch}-{release} | |
{major}.{minor}.{patch} | |
[bumpversion:file:docker.build] |
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
# Git branch autocomplete | |
# curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/shell/git-completion.bash | |
if [ -f ~/shell/git-completion.bash ]; then | |
. ~/shell/git-completion.bash | |
fi | |
# Show git branch | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} |
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
/* | |
WiFi Web Server LED Blink | |
A simple web server that lets you blink an LED via the web. | |
This sketch will print the IP address of your WiFi Shield (once connected) | |
to the Serial monitor. From there, you can open that address in a web browser | |
to turn on and off the LED on pin 9. | |
If the IP address of your shield is yourAddress: | |
http://yourAddress/H turns the LED on | |
http://yourAddress/L turns it off | |
This example is written for a network using WPA encryption. For |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<canvas id="myCanvas" width="400" height="400" style="border:1px solid #000000;"> | |
Your browser does not support the HTML5 canvas tag. | |
</canvas> | |
<script> | |
window.requestAnimFrame = (function(callback) { |
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
26 abcdefghijklmnopqrstuvwxyz | |
26 ABCDEFGHIJKLMNOPQRSTUVWXYZ | |
10 0123456789 | |
1lI -> 1 | |
0O -> 0 | |
26*2+10-(5-2) | |
int => key |
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
Homebrew | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
// Install ACK | |
brew install ack | |
// Install pip with pkg-config readline gdbm python sqlite | |
brew install python |
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
Shell for finding unused images in iOS project | |
Source: | |
http://stackoverflow.com/questions/6113243/how-to-find-unused-images-in-an-xcode-project | |
Version 1: | |
#!/bin/sh | |
PROJ=`find . -name '*.xib' -o -name '*.[mh]' -o -name '*.storyboard' -o -name '*.mm'` | |
for png in `find . -name '*.png'` |
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/sh | |
if [ "$#" -ne 1 ]; then | |
echo "Illegal number of parameters: " $@ ". Use xx_XX format instead." | |
exit | |
fi | |
IFS="_" arr=($1) | |
IFS=" " | |
if [ ${#arr[@]} -ne 2 ]; then | |
echo "Illegal number of parameters: " $@ ". Use xx_XX format instead." | |
exit |
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
// | |
// ARCMacros.h | |
// | |
// Created by John Blanco on 1/28/2011. | |
// Rapture In Venice releases all rights to this code. Feel free use and/or copy it openly and freely! | |
// | |
#if !defined(__clang__) || __clang_major__ < 3 | |
#ifndef __bridge | |
#define __bridge |