Skip to content

Instantly share code, notes, and snippets.

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

Nam Hoang particle4dev

👨‍💻
Building
View GitHub Profile
@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
{
@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 / 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 / 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 / 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'
@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);

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

Docker Container Name

A one paragraph description about the container.

Getting Started

These instructions will cover usage information and for the docker container

Prerequisities

@particle4dev
particle4dev / README-Template.md
Created November 13, 2017 17:08 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@particle4dev
particle4dev / follow.php
Created December 24, 2017 09:20 — forked from cosenary/follow.php
Instagram API class - follow user example
<?php
require 'Instagram.php';
use MetzWeb\Instagram\Instagram;
$instagram = new Instagram(array(
'apiKey' => 'YOUR_APP_KEY',
'apiSecret' => 'YOUR_APP_SECRET',
'apiCallback' => 'YOUR_APP_CALLBACK' // must point to success.php
));