Skip to content

Instantly share code, notes, and snippets.

Avatar

Ari Gesher arigesher

View GitHub Profile
@arigesher
arigesher / aws_instance_metadata.bash
Created Jan 30, 2020
bash-fu to set AWS instance metadata as environment variables
View aws_instance_metadata.bash
#!/bin/bash -x
_JQ_FILTER='.ds | .dynamic | .["instance-identity"] | .document'
_INSTANCE_DATA=/var/run/cloud-init/instance-data.json
export _instance_doc=$(jq "$_JQ_FILTER" $_INSTANCE_DATA)
for key in $(echo $_instance_doc | jq -r 'keys|.[]'); do
value=$(echo $_instance_doc | jq -r .$key)
declare -x _AWS_${key^^}=${value}
done
@arigesher
arigesher / trigger_build.bash
Created May 22, 2019
CircleCI manual trigger
View trigger_build.bash
#!/bin/bash -e
# Usage:
#
# 1. set $CIRCLE_API_TOKEN
# 2. run `./trigger-build <account> <oroject> [<branch>]`
#
# For https://github.com/iambob/myfirstproject:
#
# trigger_build iambob myfirstproject
@arigesher
arigesher / gdal1-json-c-013.patch
Created May 24, 2018
GDAL 1.11.5 patch for dealing with json-c lib 0.13
View gdal1-json-c-013.patch
diff --git a/frmts/arg/argdataset.cpp b/frmts/arg/argdataset.cpp
index 5a7e646..c40101a 100644
--- a/frmts/arg/argdataset.cpp
+++ b/frmts/arg/argdataset.cpp
@@ -55,6 +55,10 @@ static float CPLNaN(void)
# endif
#endif
+#ifndef error_ptr
+#define error_ptr(error) ((void*)error)
@arigesher
arigesher / yamlprint.ipynb
Created Jan 26, 2018
YAML for better output formatting
View yamlprint.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arigesher
arigesher / sparklage vecnav data.ipynb
Created Oct 19, 2016
Loading vecnav data from sparklage keys
View sparklage vecnav data.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arigesher
arigesher / sparklage vecnav data.ipynb
Created Oct 19, 2016
Loading vecnav data from sparklage keys
View sparklage vecnav data.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arigesher
arigesher / keybase.md
Created Apr 12, 2016
Keybase identity verification
View keybase.md

Keybase proof

I hereby claim:

  • I am arigesher on github.
  • I am arigesher (https://keybase.io/arigesher) on keybase.
  • I have a public key whose fingerprint is 4C71 6357 7C2A FE86 63AC 6776 6BA7 2DF9 8E5E 3182

To claim this, I am signing this object:

View -
This file has been truncated, but you can view the full file.
==> Installing qgis from homebrew/science
==> Downloading http://qgis.org/downloads/qgis-1.8.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/qgis-1.8.0.tar.bz2
==> Verifying qgis-1.8.0.tar.bz2 checksum
tar xvf /Library/Caches/Homebrew/qgis-1.8.0.tar.bz2
x qgis-1.8.0/
x qgis-1.8.0/.gitignore
x qgis-1.8.0/.mailmap
x qgis-1.8.0/BUGS
@arigesher
arigesher / find_value.coffee
Last active Aug 29, 2015
Snippet to recursively search a JSON structure for a leaf value - returns the path
View find_value.coffee
find_value = (haystack, needle, cache=new WeakMap()) ->
# console.log "haystack: ", haystack
# console.log "needle: ", needle
try
if haystack?
unless typeof haystack == 'object' and cache.has haystack
cache.set haystack, true
for key, value of haystack
@arigesher
arigesher / sector_highlights.html
Created Nov 1, 2014
d3 demo of sector highlighting code
View sector_highlights.html
<html>
<head>
<body style='align: center'>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class='content' style='margin: auto'>
</div>
<script>
var data =
[