Skip to content

Instantly share code, notes, and snippets.

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

Mario Vejlupek devopsmariocom

💭
building Cloud Native Thermostat 🔥 🥶
View GitHub Profile
@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) {
@BretFisher
BretFisher / docker-for-mac.md
Last active March 31, 2025 10:12
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


@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!

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
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