Skip to content

Instantly share code, notes, and snippets.

Emmanuel N Kyeyune emmanuelnk

View GitHub Profile
@tomfa
tomfa / handler.py
Last active Jun 19, 2020
AWS Lambda: Python store to S3
View handler.py
# This file is your Lambda function
import json
import boto3
def save_to_bucket(event, context):
AWS_BUCKET_NAME = 'my-bucket-name'
s3 = boto3.resource('s3')
bucket = s3.Bucket(AWS_BUCKET_NAME)
path = 'my-path-name.txt'
@Geoyi
Geoyi / install virtualenv ubuntu 16.04.md
Created Sep 16, 2017 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04
View install virtualenv ubuntu 16.04.md

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@Geoff-Ford
Geoff-Ford / composing-software.md
Last active Jun 29, 2020
Eric Elliott's Composing Software Series
View composing-software.md

Eric Elliott's "Composing Software" Series

A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.

Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.

@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active Jun 24, 2020
Eric Elliott's Master the JavaScript Interview Series
View master-javascript-interview.md
View semantic-commit-messages.md

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

View commit-message-guidelines.md

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@ukcloudpro
ukcloudpro / ukcloudpro-lambda-sns-slack.js
Created Apr 23, 2017
AWS Lambda node.js code to pass SNS messages to Slack Webhook
View ukcloudpro-lambda-sns-slack.js
var https = require('https');
var util = require('util');
var SLACK_CHANNEL = process.env.SLACK_CHANNEL;
var SLACK_PATH = process.env.SLACK_PATH;
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
@judy2k
judy2k / parse_dotenv.bash
Created Mar 22, 2017
Parse a .env (dotenv) file directly using BASH
View parse_dotenv.bash
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
View github-cheat-sheet.md

Useful Git commands

This is just stuff that I have put down that I find I use a lot of the time for my own reference.

Latest changes from repo to your machine

$ git pull
@martinapugliese
martinapugliese / boto_dynamodb_methods.py
Last active May 16, 2020
Some wrapper methods to deal with DynamoDB databases in Python, using boto3.
View boto_dynamodb_methods.py
# Copyright (C) 2016 Martina Pugliese
from boto3 import resource
from boto3.dynamodb.conditions import Key
# The boto3 dynamoDB resource
dynamodb_resource = resource('dynamodb')
def get_table_metadata(table_name):
You can’t perform that action at this time.