Skip to content

Instantly share code, notes, and snippets.

View thomas-alrek's full-sized avatar

Thomas Alrek thomas-alrek

View GitHub Profile
http {
upstream backend {
server node1.example.com;
server node2.example.com;
}
}
server {
location / {
proxy_pass http://backend;
@thomas-alrek
thomas-alrek / README.md
Last active August 26, 2022 12:28
macOS PHP development environment setup

Automated macOS PHP development environment setup

Highly opionionated.

Installs the following automatically:

  • Homebrew
  • Composer
  • JQ
  • PHP
#include "ScriptRunner.h"
UWORD script_ptr = NULL;
UWORD script_start_ptr = NULL;
UBYTE script_ptr_bank = NULL;
UBYTE script_continue = NULL;
UBYTE script_stack_ptr = NULL;
STACKFRAME script_stack[8] = {
@thomas-alrek
thomas-alrek / Object.js
Created January 21, 2018 15:35
Simple ES6 observable/reactive Object
const $watchers = Symbol('watchers')
export default class {
constructor (props = {}, handlers = []) {
this[$watchers] = []
this[Symbol.toStringTag] = this.constructor.name
Object.defineProperty(this, '$watch', {
value (prop, handler) {
if (this[prop]) {
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
@thomas-alrek
thomas-alrek / Reimplements ++ and -- operators in Swift 3
Created June 8, 2017 20:27
Increment_Decrement_Operators.swift
prefix operator ++
prefix operator --
postfix operator ++
postfix operator --
@discardableResult prefix func ++( a: inout Int) -> Int {
a += 1
return a
}