Skip to content

Instantly share code, notes, and snippets.

View elmariofredo's full-sized avatar
💭
building Cloud Native Thermostat 🔥 🥶

Mario Vejlupek elmariofredo

💭
building Cloud Native Thermostat 🔥 🥶
View GitHub Profile
locals {
task_definition_family = "${local.prefix}-${var.ecs_task_name}"
}
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}
data "aws_ecs_task_definition" "hack_get_image" {
count = var.preserve_image ? 1 : 0
task_definition = local.task_definition_family
anonymous
anonymous / run.sh
Created November 29, 2017 09:44
Resolve Mac OS High Sierra root empty password issue
#!/bin/bash
sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool NO
# Enter some long unpredictable password
sudo passwd root
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

@BretFisher
BretFisher / docker-for-mac.md
Last active November 8, 2024 13:45
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@sskoopa
sskoopa / ssr.js
Created November 19, 2016 16:33
Super simple and fast preact server side rendering
function ssr(req, res, url) {
let user = req.user //comes from passport
const preloadedState = { user, url } // Compile an initial state
const store = configureStore(preloadedState) // Create a new Redux store instance
const html = render(<Provider store={store}><Html /></Provider>) // Render the component to a string
const finalState = store.getState() // Grab the initial state from our Redux store
res.send(renderFullPage(html, finalState)) // Send the rendered page back to the client
}
function renderFullPage(html, preloadedState) {

Reviewer's checklist - How to boost your code review skills

Purpose of my lightning talk is to present insights I've reached as a reviewer/ reviewee in the last couple of months.

I will answer these questions:

  • What makes a good code review good?
  • How to build guidelines? Dos and Don'ts.
  • How to educate dev/team members about the code review process?
@eproxus
eproxus / dict.py
Last active May 15, 2018 09:18
Ansible dict map helper
"""Ansible dict filters."""
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@RomanSaveljev
RomanSaveljev / file-missing.bats
Last active April 28, 2016 15:50
Docker bug report additional stuff
#!sh
dockerfile() {
cat <<EOF
FROM debian:8
RUN echo 123 >/a && printf abc >/b
RUN echo 456 >/a && echo def >>/b
EOF
}
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
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