Skip to content

Instantly share code, notes, and snippets.

View particle4dev's full-sized avatar
👨‍💻
Building

Nam Hoang particle4dev

👨‍💻
Building
View GitHub Profile

Docker Container Name

A one paragraph description about the container.

Getting Started

These instructions will cover usage information and for the docker container

Prerequisities

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@particle4dev
particle4dev / HashTable.js
Created October 23, 2017 14:11 — forked from alexhawkins/HashTable.js
Correct Implementation of a Hash Table in JavaScript
var HashTable = function() {
this._storage = [];
this._count = 0;
this._limit = 8;
}
HashTable.prototype.insert = function(key, value) {
//create an index for our storage location by passing it through our hashing function
var index = this.hashFunc(key, this._limit);
@particle4dev
particle4dev / cleanup-docker.sh
Last active October 10, 2017 07:00
cleanup-docker.sh
DOCKER remove exited container
docker rm $(docker ps -a -f status=exited -f status=created -q)
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
@particle4dev
particle4dev / sed cheatsheet
Created September 15, 2017 12:10 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
#!/bin/bash
# Usage: slackpost --text="123" <channel=???>
function slackpost {
for i in "$@"
do
case $i in
-t=*|--text=*)
TEXT="${i#*=}"
@particle4dev
particle4dev / slack-status-update.sh
Created September 4, 2017 17:30 — forked from DanPurdy/slack-status-update.sh
Notify a slack channel about eslint and karma tests passing
cd ${bamboo.build.working.directory}
if [ -d "test-reports" ] 1> /dev/null 2>&1; then
curl -X POST --data-urlencode \
'payload={
"channel": "#SLACK-CHANNEL",
"username": "Bamboo Bot",
"text": "Built succesfully",
"icon_emoji": ":octocat:",
"attachments": [
{
@particle4dev
particle4dev / slackpost
Created September 4, 2017 10:20 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@particle4dev
particle4dev / .babelrc
Created August 10, 2017 15:59 — forked from justinsoliz/.babelrc
express + aws serverless proxy
{
"presets": [ "es2015", "flow" ],
"plugins": ["transform-object-rest-spread"]
}
@particle4dev
particle4dev / resources.tf
Created August 8, 2017 07:12 — forked from justinsoliz/resources.tf
Terraform S3 to Lambda notification
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_iam_role" "iam_for_terraform_lambda" {
name = "app_${var.app_env}_lambda"
assume_role_policy = <<EOF
{