Skip to content

Instantly share code, notes, and snippets.

View slogsdon's full-sized avatar

Shane Logsdon slogsdon

View GitHub Profile
SERVICE_PLAN_ID=$(az appservice plan show --name $SERVICE_PLAN_NAME --resource-group $SERVICE_PLAN_RESOURCE_GROUP_NAME --query id --output tsv)
RESOURCE_GROUP_NAME=$(basename `pwd`)
RESOURCE_GROUP_LOCATION=$(az appservice plan show --name $SERVICE_PLAN_NAME --resource-group $SERVICE_PLAN_RESOURCE_GROUP_NAME --query location --output tsv)
# Create a resource group.
# useful imports
from import HpsServicesConfig
from import (
from time import sleep
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent (forkIO)
import Control.Monad (forever)
import Data.ByteString.Builder (Builder, hPutBuilder, lazyByteString)
import qualified Data.ByteString.Lazy as BS
import Data.Monoid ((<>))
import GHC.IO.Handle (BufferMode (..), hClose,
hSetBinaryMode, hSetBuffering)
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent (forkIO)
import Control.Monad (forever)
-- import qualified Data.ByteString.Char8 as S
import Network.Socket hiding (recv)
import Network.Socket.ByteString (sendAll)
main :: IO ()
# @spec Control.Applicative.apply(Control.Applicative.t, Control.Functor.t) :: Control.Applicative.t
# @spec Control.Monad.bind(Control.Monad.t, (term -> Control.Monad.t)) :: Control.Monad.t
import Data.Maybe
alias Control.Applicative, as: A
import Control.Monad
(&(&1 + 2))
|> just
|> A.apply(just(5))
{-#LANGUAGE OverloadedStrings #-}
module Main where
import Data.Monoid
import Data.Text (Text, pack)
import Web.Spock.Safe
main :: IO ()
main =
runSpock 3000 $ spockT id $
slogsdon / ServiceContainer.php
Created July 8, 2015 18:05
Basic dependency injection container for PHP
class ServiceContainer
private static $services;
private static $generators;
public function __construct()
self::$services = [];
slogsdon / Dockerfile
Last active April 14, 2024 19:07
Simple Wordpress cluster backed by MySQL and a Redis object cache, all behind HAProxy
# Basic setup to copy Wordpress files,
# expected to be at '.', into the image
FROM orchardup/php5
ADD . /code
module Temp where
import System.Directory
path :: String
path = "/Users/shane.logsdon/Code/haskell/"
files :: IO [FilePath]
files = getDirectoryContents path
defmodule OfflineDocs do
def parse_dep({dep, constraint}) when constraint |> is_binary, do: parse_dep({dep, constraint, []})
def parse_dep({dep, options}) when options |> is_list, do: parse_dep({dep, "", []})
def parse_dep({dep, _contraint, options}) do
if options[:only] == nil or options[:only] == Mix.env do
[dep: dep]