Skip to content

Instantly share code, notes, and snippets.

View brodul's full-sized avatar

Andraz Brodnik brodul

View GitHub Profile

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@sigma
sigma / redis-mini.nix
Created April 17, 2016 06:30
minimal #redis #docker image with #nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
su_exec = pkgs.stdenv.mkDerivation {
name = "su-exec-0.2";
src = fetchurl {
url = https://github.com/ncopa/su-exec/archive/v0.2.tar.gz;
sha256 = "09ayhm4w7ahvwk6wpjimvgv8lx89qx31znkywqmypkp6rpccnjpc";
@yang-wei
yang-wei / decode.md
Last active April 2, 2024 20:18
Elm Json.Decode tutorial and cheatsheet

When receiving JSON data from other resources(server API etc), we need Json.Decode to convert the JSON values into Elm values. This gist let you quickly learn how to do that.

I like to follow working example code so this is how the boilerplate will look like:

import Graphics.Element exposing (Element, show)
import Task exposing (Task, andThen)
import Json.Decode exposing (Decoder, int, string, object3, (:=))

import Http
@ceejbot
ceejbot / proposal.md
Last active November 25, 2015 21:13
monitoring proposal

Go here for the latest + some code.

numbat

An alerting engine for a metrics & monitoring system.

This is the same approach I wanted in my initial spike, only instead of writing a custom collector & using an existing alerting engine (riemann), I'm proposing using an existing collector (hekad) and writing the alerting engine.

The system

@matejc
matejc / nixmy
Last active December 28, 2015 08:19
nixmy - my nixpkgs repo manage script inspired by nixdev but much much simpler
#!/bin/sh
# !!!MODIFY NEXT 3 LINES BEFORE RUNNING ANY COMMANDS!!!
export NIX_MY_PKGS='/home/matej/workarea/nixpkgs' # where the local repo is/will be after nixmy-init
export NIX_USER_PROFILE_DIR='/nix/var/nix/profiles/per-user/matej' # change your user name
export NIX_MY_GITHUB='git://github.com/matejc/nixpkgs.git' # your nixpkgs git repository
# after running nixmy-init you will have nixpkgs directory in current working directory
#
@matejc
matejc / Xvncmy.sh
Last active December 27, 2015 12:49
my hydra release files
#!/usr/bin/env bash
# requirements: pkgs.tightvnc, pkgs.xorg.fontmiscmisc, pkgs.xorg.fontcursormisc
function attr2path {
echo "let pkgs = import <nixpkgs> {}; in (toString $1)+\"$2\"" | nix-instantiate --eval-only --strict - | cut -d "\"" -f 2
}
VNCFONTS=`attr2path pkgs.xorg.fontmiscmisc /lib/X11/fonts/misc`,`attr2path pkgs.xorg.fontcursormisc /lib/X11/fonts/misc`
@glarrain
glarrain / supervisor
Created August 6, 2013 16:14
logrotate.d/supervisor: config file for logrotate for Supervisor logs (includes explanation of each directive)
/var/log/supervisor/*.log {
weekly
rotate 52
compress
delaycompress
notifempty
missingok
copytruncate
}
@garbas
garbas / .gitignore
Last active December 15, 2015 16:59
.installed.cfg
bin/
eggs/
include/
lib/
nixenv
parts/
@mxriverlynn
mxriverlynn / app_steps.js
Created November 26, 2012 21:45
A backbone / marionette state machine for wizard / workflow
MyApp.module('MyApp.SomeBuilder', function(SomeBuilder, App, Backbone, Marionette, $, _){
'use strict';
// Controller
// ----------
SomeBuilder.Controller = Marionette.Controller.extend({
initialize: function(options){
this.navbarRegion = options.navbarRegion;
this.mainRegion = options.mainRegion;
@w0rm
w0rm / restful_app.py
Last active May 13, 2021 17:16
RESTful controller with web.py
import web
import json
from restful_controller import RESTfulController
urls = (
r'/resources(?:/(?P<resource_id>[0-9]+))?',
'ResourceController',
)