Skip to content

Instantly share code, notes, and snippets.

View grndvl1's full-sized avatar
🎃
Working From RV

John Matthews grndvl1

🎃
Working From RV
  • Cars.com
  • Chicago
View GitHub Profile
@JacquesSmuts
JacquesSmuts / build.gradle
Last active November 2, 2021 17:50
Determining versionCode based on CircleCI build number
android {
defaultConfig {
versionName "1.9.1"
versionCode getBuildVersion() as int
}
}
// Don't name this getVersionCode() or things will break
static def getBuildVersion() {
def version = 123
@cjus
cjus / jsonval.sh
Created June 26, 2011 17:42
Extract a JSON value from a BASH script
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl -s -X GET http://twitter.com/users/show/$1.json`
prop='profile_image_url'
picurl=`jsonval`