Skip to content

Instantly share code, notes, and snippets.

View mbbx6spp's full-sized avatar
🎯
Focusing

Susan Potter mbbx6spp

🎯
Focusing
View GitHub Profile
@stevekinney
stevekinney / web-performance.md
Last active January 31, 2024 14:23
Web Performance Workshop

Web Performance

Requirements

Repositories

@mbbx6spp
mbbx6spp / ldapserver.nix
Last active October 29, 2019 13:26
Suggested NixOS LDAP server configuration for Lookout. Nix, NixOS, OpenLDAP, LDAP. Basic (common sense) SSH/PAM/sudo settings too.
{ pkgs, config, ... }:
{
imports = [
<nixpkgs/nixos/modules/profiles/headless.nix>
];
# Enable sudo logins if the user's SSH agent provides a key
# present in <filename>~/.ssh/authorized_keys</filename>.
# This allows machines to exclusively use SSH keys instead of
# passwords.
@jdegoes
jdegoes / RedEyesPreview.scala
Created February 4, 2014 17:20
A preview of the RedEyes web framework
/*
* RedEyes generates rich descriptions of the API, as well as valid examples for
* all parameters (in this case, example header, query parameter, and content).
*
* The API can also be used to generate client libraries in a variety of languages.
*
* Service handlers are strongly-typed (e.g. retrieveEmployees expects an integer
* and a ModelDesc). Any errors in using the API automatically generate rich
* descriptions on what was expected.
*/
@mbbx6spp
mbbx6spp / RECIPE.md
Created January 8, 2014 03:21
Brownie in a mug

Brownie in a mug recipe

Ingredients

  • 1/4 cup of sugar
  • 1/4 cup of flour
  • 2 tbsp of cocoa
  • a pinch of salt
  • 2 tbsp of olive oil
  • 3 tbsp of water
@sam
sam / Example.scala
Created September 18, 2013 22:50
Scalaz's Applicative Functor for Futures.
// Zip together a couple Futures, including one that returns an Option
// and pass them to a function to give me a new object:
api.channels.tree zip api.pages.getByRoute(route) map {
case (tree, Some(page)) => Some(new PagePresenter(context, tree, page))
case _ => None
}
// Now with an Applicative Functor!
(api.channels.tree |@| api.pages.getByRoute(route)) {
@gclaramunt
gclaramunt / cc.sh
Last active October 20, 2021 21:49
This is my stupid script to have sbt-like recompiling in Haskell (now with cabal)
CALL=${1:-"cabal build"}
$CALL
while inotifywait -qq -r -e modify .; do
echo '<><><><> Starting build <><><><>';
echo `date`;
$CALL;
echo '<><><><> Done <><><><>';
sleep 1
done
@bnoordhuis
bnoordhuis / gc.stp
Created November 15, 2012 14:36
systemtap script that prints aggregated node.js garbage collector statistics
#!/usr/bin/env stap
global samples
global all_samples
global timestamp
probe process("node").mark("gc__start")
{
timestamp = gettimeofday_us()
}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@nherment
nherment / backup.sh
Created February 29, 2012 10:42
Backup and restore an Elastic search index (shamelessly copied from http://tech.superhappykittymeow.com/?p=296)
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
@mumoshu
mumoshu / build.sbt
Created January 10, 2012 02:52
DES encryption in Scala
name := "DES encryption in Scala"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "commons-codec" % "commons-codec" % "1.6"