Skip to content

Instantly share code, notes, and snippets.

@hollanddd
hollanddd / gitflow-breakdown.md
Created May 14, 2021 00:04 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@hollanddd
hollanddd / aws-cdk-singleton-pattern.md
Last active April 20, 2021 15:38
[aws-cdk] tracking singletons

While adding L2 constructs for AWS IoT I have identified a singleton pattern shared among several packages. This document demonstrates that the pattern is common enough to be found in several packages yet sparsley documented and leads to issues. Are these issues resolved with better understanding through documentation or does the pattern ussage warrant further discussion?

Pattern Background

From @aws-cdk/core README.md:

When defining resources for a custom resource provider, you will likely want to define them as a stack singleton so that only a single instance of the provider is created in your stack and which is used by all custom resources of that type.

#!/bin/bash
systemctl daemon-reload
systemctl restart docker.service
docker swarm leave --force
site=$(curl -s https://api.ipify.org/?format=text) echo $site docker swarm join --advertise-addr $site \
--token SWMTKN-1-2nle9d1yoocuhtchkx9m1uba0xs8uwwquj1dq1v5ipjgp4fka5-aabs7ghllav8g7wjbv62zz3tp \
172.31.62.216:2377
@hollanddd
hollanddd / 0_reuse_code.js
Created September 7, 2016 16:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hollanddd
hollanddd / git patterns.md
Created May 27, 2016 14:09 — forked from wayspurrchen/git patterns.md
Useful Git Techniques

History

Show file at certain commit

git show <hash>:<file>

Show history of a file

git log -p <filename>

@hollanddd
hollanddd / color-palette.scss
Created April 7, 2016 19:02 — forked from cmacdonnacha/color-palette.scss
Material Design Color Palette
$white: #ffffff;
$black: #000000;
$red50: #ffebee;
$red100: #ffcdd2;
$red200: #ef9a9a;
$red300: #e57373;
$red400: #ef5350;
$red500: #f44336;
$red600: #e53935;
$red700: #d32f2f;
@hollanddd
hollanddd / gitconfig.txt
Created March 27, 2015 20:17
aliases for git
[alias]
st = status -sb
tree = log --graph --oneline --decorate --color --all
standup = log --since '1 day ago' --oneline
graph = log --graph --pretty=format':%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset'
everything = log --pretty=format:'%C(yellow)%h %C(blue)%ad%C(red)%d %C(reset)%s%C(green) [%cn]' --decorate --date=short

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

--
-- PostgreSQL Northwind Database v1.0 from Ramiro Estigarribia Canese
-- you may contact him at email [email protected]
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
@hollanddd
hollanddd / email_attachment_fetcher.py
Last active August 29, 2015 13:55
fetches email attachments
import imaplib, email
def fetch_csv_from_email(self):
file_name_list = []
detatch_dir = '.'
if 'files' not in os.listdir(detatch_dir):
os.mkdir('files')
mail_session = imaplib.IMAP4_SSL('your_mail_box')
typ, account_details = mail_session.login('username', 'psswd')