Skip to content

Instantly share code, notes, and snippets.

@impactmass
impactmass / docker-compose.yml
Created September 29, 2021 15:24
Quick run postgresql
version: "3"
services:
postgresql:
image: postgres
container_name: container_name
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres_user
/* Learning from https://rachelandrew.co.uk/ */
/* config stuff */
/* Coolors Exported Palette - coolors.co/694486-2b193d-dbdbdb-b0b5b3-040303 */
/* RGB */
footer {
padding: 10px;
background-color: #2b193d;
color: #fcf9f9;
font-size: 90%;
// Prints a tower based on the height passed into the main function
// e.g height of 8 prints this:
// # #
// ## ##
// ### ###
// #### ####
// ##### #####
// ###### ######
// ####### #######
// ######## ########
@impactmass
impactmass / inventory-data-flow.txt
Created June 27, 2019 19:36
sequence diagram for reaction inventory data flow
title Inventory Data Flow
Kafka Topic -> Shippable-Inventory-Plugin:
note over Shippable-Inventory-Plugin:
Consumer calls bulk-write mutation.
This function is not defined in "Inventory" plugin
end note
Shippable-Inventory-Plugin -> Simple-Inventory-Plugin: updateSimpleInventoryBulk()

Keybase proof

I hereby claim:

  • I am impactmass on github.
  • I am impactmass (https://keybase.io/impactmass) on keybase.
  • I have a public key ASBqgz36Iy3-ppxP0aPRQJbtEk0fpRlGkOpYtDXDHYq20Ao

To claim this, I am signing this object:

@impactmass
impactmass / docker_load__input.md
Last active June 23, 2018 19:54
Accept input from a file

I've always used this to load an image from a tar

docker load < image.tar

is same as:

docker load --input image.tar

Useful when I had to run something like:

@impactmass
impactmass / .eslintrc
Created May 30, 2017 09:39
sample_eslintrc_mostly_reasonable_rules
{
"env": {
"browser": true,
"es6": true,
"node": true,
"mocha": true
},
"extends": "airbnb",
"rules": {
"comma-dangle" : [2, "never"],
@impactmass
impactmass / use_of_func.js
Last active May 29, 2017 09:51
Beginner: Use of descriptive functions + promise chain
const UserController = {
create(req, res) {
const userData = req.body;
const query = {
where: { email: userData.email }
};
const defaultRole = {
where: { title: 'Writer' }
};
@impactmass
impactmass / loader-dir.js
Created April 13, 2016 11:09
Add three-dot style loader to specific elements that hold API loaded content
angular.module('app', [])
.directive('loader', function() {
return {
restrict: 'A',
link: function link(scope, element, attrs) {
var loaderHTML = angular.element('<div class="loading-spinner-context"><div class="loading-spinner-wrapper"' + 'id="app-loader"><span class="loading-spinner white"><i class="one"></i><i class="two"></i><i class="three"></i></span></div></div>');
scope.$watch(attrs.loader, function(newVal) {
if (!newVal) {
if ($(element).children('.loading-spinner-context').length) {
$('.loading-spinner-context').css('display', 'block');
@impactmass
impactmass / read-more-liquid-post.html
Created February 25, 2016 07:05
read more link in jekyll blog using liquid
{% capture content_words %}
{{ post.content | number_of_words }}
{% endcapture %}
{% capture excerpt_words %}
{{ post.content | truncatewords: 250 | number_of_words }}
{% endcapture %}
{% if content_words != excerpt_words %}
<p class="right"><a href="{{site.baseurl}}{{ post.url }}">Read more</a></p>