-
Production monitoring
-
Alerting
- Dead Man's Snitch - Dead simple alerting. Sends you an email if a URL isn't requested every N minutes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void One() { Two(); } | |
static void Two() { Three(); } | |
static void Three() { throw new Exception("Error"); } | |
static void Main(string[] args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# usage: dotenv irb | |
begin | |
File.foreach('.env') do |line| | |
line = line.strip | |
unless line.start_with?('#') | |
parts = line.split '=', 2 | |
if parts.length == 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paste this into a LINQPad C# Program | |
void Main() | |
{ | |
var str = @"Key1=Value1 | |
Key2:Key3=Value2"; | |
var strings = str.Split(new []{"\r\n"}, StringSplitOptions.None) | |
.Select(s => s.Split(new[]{'='}, 2)); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApplication1 | |
{ | |
public class Program | |
{ | |
public static void Main() | |
{ | |
try | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Truncate paths in the prompt to 2 characters so long directories don't take up the whole window | |
function Prompt { | |
$path = $ExecutionContext.SessionState.Path.CurrentLocation | |
$segment = Split-path -Leaf $path | |
$path = Split-Path $path | |
$segments = @( $segment ) | |
while ($segment -ne $path -and $path -ne "") { | |
$segment = Split-Path -Leaf $path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Enumerable(arr) { | |
this.toArray = function () { | |
return arr | |
} | |
this.filter = function (fn) { | |
return new Enumerable(arr.filter(fn)) | |
} | |
this.map = function (fn) { |
A simple function for allowing partial function application in JavaScript.
function foo(a, b, c) {
return [a, b, c]
}
var bar = foo.curry(1, 2)
bar(3) // => [1, 2, 3]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
node "%~dp0\jspretty.js" |