Skip to content

Instantly share code, notes, and snippets.

View aripalo's full-sized avatar

Ari Palo aripalo

View GitHub Profile
@delemach
delemach / slackNotify.js
Last active November 1, 2018 18:41 — forked from turret-io/slackNotify.js
Parse SNS notification from Elastic Beanstalk and publish to Slack channel
var http = require('https');
var querystring = require('querystring');
// set the post request options
var reqOptions = {
hostname: 'hooks.slack.com',
port: 443,
path: '/services/YOUR/SLACK/HOOK_HERE',
method: 'POST'
};
@tomkis
tomkis / reducers-as-generators.js
Created November 20, 2015 16:18
what if your reducers were generators?
// You can defer the side-effect execution in middlewares
const sideEffect = appState => dispatch => localStorage.setItem('counter', appState);
function plainOldReducer(appState) {
return appState + 1;
}
// Composition simply work
function nestedReducer*(appState, action) {
if (action === FOO) {
@maxim
maxim / gh-dl-release
Last active May 13, 2025 00:14
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@paulirish
paulirish / what-forces-layout.md
Last active July 10, 2025 08:36
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@RobertoSchneiders
RobertoSchneiders / elasticbeanstalk_deploy_iam_policy.md
Last active October 29, 2024 19:38
IAM Policy for deploy on Elastic Beanstalk

I am deploying with this IAM using Codeship and Circle CI to Elastic Beanstalk. I had a lot of trouble with this config. I talked to the aws support for about 6 hours until this worked properly, so, I guess it is worth to share.

UPDATE: In the end, I have to use the AWSElasticBeanstalkFullAccess policy. My custom policy keep breaking every week with some new added permission or some EB internal change. Anyway, the IAM I was using is below.

This works for me with CircleCI and EB Cli.

{
    "Version": "2012-10-17",
    "Statement": [
        {
@grrowl
grrowl / fetchDataComponent.jsx
Last active October 19, 2015 20:33
redux and react-router helper to provide (dispatch, storeState) to a static fetchData method
'use strict';
/*
# FetchData
If property callback `if(storeState)` return true, calls property callback
`fetchData(dispatch, storeState)` so it may dispatch FETCH actions.
## Usage:
@ianblenke
ianblenke / Makefile
Last active October 7, 2019 12:35
A Makefile for creating, updating, watching, and deleting a CloudFormation VPC as per gists 9f4b8dd2b39c7d1c31ef and 0a6a6f26d1ecaa0d81eb
STACK:=myapp-dev
TEMPLATE:=cloudformation-template_vpc-iam.json
PARAMETERS:=cloudformation-parameters_myapp-dev.json
AWS_REGION:=us-east-1
AWS_PROFILE:=aws-dev
all:
@which aws || pip install awscli
aws cloudformation create-stack --stack-name $(STACK) --template-body file://`pwd`/$(TEMPLATE) --parameters file://`pwd`/$(PARAMETERS) --capabilities CAPABILITY_IAM --profile $(AWS_PROFILE) --region $(AWS_REGION)
@AndiDittrich
AndiDittrich / AesUtil.js
Last active April 16, 2025 14:46
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// SPDX-License-Identifier: MPL-2.0
// AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// ----------------------------------------------------------------------------------------
// the encrypted datablock is base64 encoded for easy data exchange.
// if you have the option to store data binary save consider to remove the encoding to reduce storage size
// ----------------------------------------------------------------------------------------
// format of encrypted data - used by this example. not an official format
//
// +--------------------+-----------------------+----------------+----------------+
@triblondon
triblondon / _proposal.md
Last active October 9, 2016 12:48
Paid content pass specification proposal

Paid content pass specification proposal

Paid content makes up a significant portion of the content available online, especially high value content. Users who are seeking information via search engines frequently run queries for which the most relevant content is to be found from payment-required sources. However, in order that search crawlers are able to index this content, paid content publishers typically permit such crawlers to access their pages as if the crawler were a paid-up subscriber. As a result, search results displayed to users of search engines can create the expectation of free content and disappointment or frustration when the user is denied access.

To date, search providers have attempted to solve this problem by requiring content owners to make content available to searchers in the same form as it is available to the crawler, when a searcher clicks on a search result, a practice known as "First click free". In most cases it is a breach of the search provider's terms of service to bar se

@magnetikonline
magnetikonline / README.md
Last active June 7, 2023 20:57
AWS Elastic Beanstalk deploy user restricted IAM policy.

AWS Elastic Beanstalk deploy user restricted IAM policy

An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.

Where:

  • REGION: AWS region.
  • ACCOUNT_ID: AWS account ID.
  • APPLICATION_NAME: Desired target Elastic Beanstalk application name(space).
  • IAM_INSTANCE_PROFILE_ROLE: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.