Skip to content

Instantly share code, notes, and snippets.


jimmycliff obonyo obonyojimmy

View GitHub Profile
obonyojimmy /
Created Dec 20, 2020 — forked from danrubins/
Legal Robot's options for helmet.js

Security Headers at Legal Robot

We're big fans of open source software at Legal Robot. We also know that getting security right is a tough job, so we want to share some of the useful tools we use to build and run Legal Robot and keep it secure.

We are also proud to run Legal Robot on the Meteor framework for Node.js. With this recent change, Helmet.js becomes the official recommendation for security headers in Meteor, replacing the previous Meteor browser-policy package.

One of the most helpful tools in our Meteor security toolbox at Legal Robot is Content Security Policy (CSP)  — basically, our server tells the browser what code it is allowed to run and how to handle something like code injection from a malicious browser extension.

CSP can be quite tricky, but there are some excellent tools out there to help, like [Google'

obonyojimmy /
Created Dec 6, 2020 — forked from xflr6/
Recursively traverse the directory tree of a Google Drive folder as variation of os.walk()
# - os.walk variation with Google Drive API
import os
from apiclient.discovery import build # pip install google-api-python-client
FOLDER = 'application/'
def get_credentials(scopes, secrets='~/client_secrets.json', storage='~/storage.json'):
from oauth2client import file, client, tools

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

# A1. Launch a notebook instance and get URL to Jupyter running on it
STARTUP_SCRIPT="git clone"
echo "Launching $INSTANCE_NAME"
gcloud compute instances create ${INSTANCE_NAME} \
--machine-type=n1-standard-2 \
--scopes=, \
obonyojimmy / info.plist
Created Sep 16, 2020 — forked from dabit3/info.plist
Example React Native Xcode info.plist with redirect
View info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
obonyojimmy / spot_price.config
Created Aug 29, 2020 — forked from rahulmamgain/spot_price.config
Spot Instance Configuration Elastic Beanstalk
View spot_price.config
Type: "AWS::AutoScaling::LaunchConfiguration"
Namespace: "aws:elasticbeanstalk:application:environment"
OptionName: "EC2_SPOT_PRICE"
DefaultValue: {"Ref":"AWS::NoValue"}
View Install ffmpeg on AWS Linux AMI
sudo su -
cd /usr/local/bin
mkdir ffmpeg
cd ffmpeg
tar xvf ffmpeg-4.2.1-amd64-static.tar.xz
obonyojimmy /
Created Jul 20, 2020 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

obonyojimmy / assetPath.js
Last active Jun 20, 2020 — forked from Loupax/assetPath.js
A Meteor function that returns the path of the provided package asset
View assetPath.js
var getAssetPath = function getAssetPath(packageName, assetPath) {
assetPath = assetPath || '';
var meteor_root = Npm.require('fs').realpathSync(process.cwd() + '/../');
var assets_folder = meteor_root + '/server/assets/packages/'+packageName.replace(':','_')+'/'+assetPath;
return assets_folder;