Skip to content

Instantly share code, notes, and snippets.

View mbbx6spp's full-sized avatar
🎯
Focusing

Susan Potter mbbx6spp

🎯
Focusing
View GitHub Profile
@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.
*/
@holman
holman / SAFE-RUBY.rb
Created February 16, 2011 05:38
This shows some of my favorite ways to ensure robust, high-security Ruby Applications.
require 'net/https'
module SecurityModule
class HighSecurity
class ReallyHighSecurity
def self.turn_on_safe_connections
OpenSSL::SSL::VERIFY_NONE
end
end
end
@mbbx6spp
mbbx6spp / ghc
Created October 19, 2011 02:54
To fix ghc 7.0.x of all those horrible "text reloc warning" linker messages on OS X 10.7 (Lion). Based on comments to ticket #5128: http://hackage.haskell.org/trac/ghc/ticket/5128
#!/bin/sh
exedir="/usr/local/Cellar/ghc/7.0.4/lib/ghc-7.0.4"
exeprog="ghc-stage2"
executablename="$exedir/$exeprog"
datadir="/usr/local/Cellar/ghc/7.0.4/share"
bindir="/usr/local/Cellar/ghc/7.0.4/bin"
topdir="/usr/local/Cellar/ghc/7.0.4/lib/ghc-7.0.4"
pgmgcc="/usr/bin/llvm-gcc"
extraopts=-optl"-Wl,-read_only_relocs,suppress"
executablename="$exedir/ghc"
@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
@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()
}
@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)) {
@viktorklang
viktorklang / CQRS_ES_Actor.scala
Created February 1, 2011 15:05
CQRS and EventSourcing using Akka Actors
import scala.collection.mutable.ListBuffer
import akka.actor.{Actor,ActorRef}
import akka.actor.Actor._
import akka.routing.{ Listeners, Listen }
//Represents a domain event
trait Event
//A builder to create domain entities
trait EntityBuilder[Entity] {
@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"
@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.
@oxbowlakes
oxbowlakes / 3nightclubs.scala
Created May 13, 2011 15:14
A Tale of 3 Nightclubs
/**
* Part Zero : 10:15 Saturday Night
*
* (In which we will see how to let the type system help you handle failure)...
*
* First let's define a domain. (All the following requires scala 2.9.x and scalaz 6.0)
*/
import scalaz._
import Scalaz._