Skip to content

Instantly share code, notes, and snippets.

View obonyojimmy's full-sized avatar
💻
probably coding

jimmycliff obonyo obonyojimmy

💻
probably coding
View GitHub Profile
@obonyojimmy
obonyojimmy / spot_price.config
Created August 29, 2020 18:37 — forked from rahulmamgain/spot_price.config
Spot Instance Configuration Elastic Beanstalk
Resources:
AWSEBAutoScalingLaunchConfiguration:
Type: "AWS::AutoScaling::LaunchConfiguration"
Properties:
SpotPrice:
"Fn::GetOptionSetting":
Namespace: "aws:elasticbeanstalk:application:environment"
OptionName: "EC2_SPOT_PRICE"
DefaultValue: {"Ref":"AWS::NoValue"}
#
sudo su -
cd /usr/local/bin
mkdir ffmpeg
cd ffmpeg
wget https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.2.1-amd64-static.tar.xz
tar xvf ffmpeg-4.2.1-amd64-static.tar.xz
@obonyojimmy
obonyojimmy / curl.md
Created July 20, 2020 18:59 — forked from subfuzion/curl.md
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
obonyojimmy / assetPath.js
Last active June 20, 2020 18:37 — forked from Loupax/assetPath.js
A Meteor function that returns the path of the provided package asset
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;
};
@obonyojimmy
obonyojimmy / README.md
Created May 29, 2020 19:35 — forked from crypticmind/README.md
Setup lambda + API Gateway using localstack
@obonyojimmy
obonyojimmy / 00-https-single-instance.yaml
Created May 14, 2020 22:33 — forked from the-vampiire/00-https-single-instance.yaml
AWS EB elastic beanstalk single instance nodejs nginx SSL/HTTPS ebextensions config file
# REQUIREMENTS
# set the following configuration environment variables at: configuration -> software -> modify -> environment variables
# CERT_EMAIL: the email address used for registering the cert
# CERT_DOMAIN: the domain to create a cert for
# EB environment URL (listed at the top of the environment page) or a custom domain, custom domains must have a DNS CNAME record pointing to the EB environment URL
# !! MUST NOT have "http://" prefix or the trailing "/" at the end !!
# EXAMPLES
@obonyojimmy
obonyojimmy / Dockerfile
Last active May 7, 2020 18:28
Meteor Docker
FROM node:12.16.1
# Install Meteor
ENV METEOR_ALLOW_SUPERUSER true
RUN curl https://install.meteor.com/ | sh
WORKDIR /home
ADD entrypoint.sh .

This demonstrates the implementation of full text search for documents in Indexed DB.

  • Word-breaking and stemming is used to create a list of terms for each document.
  • Document records are annotated with the list of terms when added to the database.
  • A multi-entry index on the list of terms is populated.
  • A query is similarly processed into a list of terms.
  • A join over the terms is implemented using multiple cursors on the index.

The necessity of annotating records with the word list to populate the index is a limitation of the current Indexed DB API. A feature request to support custom

@obonyojimmy
obonyojimmy / authorize.js
Created March 19, 2020 00:50 — forked from kndt84/authorize.js
Sample code: how to refresh session of Cognito User Pools with Node.js and Express
const AWS = require('aws-sdk');
const CognitoUserPool = require('amazon-cognito-identity-js-node').CognitoUserPool;
const CognitoUserSession = require('amazon-cognito-identity-js-node').CognitoUserSession;
const CognitoUser = require('amazon-cognito-identity-js-node').CognitoUser;
const CognitoIdToken = require('amazon-cognito-identity-js-node').CognitoIdToken;
const CognitoAccessToken = require('amazon-cognito-identity-js-node').CognitoAccessToken;
const CognitoRefreshToken = require('amazon-cognito-identity-js-node').CognitoRefreshToken;
const cfg = require('config').config;
const COGNITO_IDENTITY_POOL_ID = cfg.COGNITO_IDENTITY_POOL_ID;
@obonyojimmy
obonyojimmy / delete_git_submodule.md
Created March 14, 2020 02:52 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule