Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View slogsdon's full-sized avatar

Shane Logsdon slogsdon

View GitHub Profile
@slogsdon
slogsdon / gist:2701393
Created May 15, 2012 12:30 — forked from davidalexander/gist:1086455
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@slogsdon
slogsdon / Ranking.php
Created September 15, 2012 03:42
Reddit Ranking Algorithms in PHP
<?php
/**
* Ranking Library
* contains alogrithms for story ranking
* Basically a PHP Implementation of reddits algorithms
*
* @author Lucas Nolte <lnolte@i.biz>
* @since 0.1
* @package Polska Wiadomosc
* @subpackage Libraries
@slogsdon
slogsdon / 01_readme.md
Last active April 2, 2016 22:19
Erlang: User authentication with bcrypt and ChicagoBoss
@slogsdon
slogsdon / keybase.md
Last active August 29, 2015 13:57
Keybase Proof

Keybase proof

I hereby claim:

  • I am slogsdon on github.
  • I am slogsdon (https://keybase.io/slogsdon) on keybase.
  • I have a public key whose fingerprint is 5D1B B50F 4AF7 EDAB B55E D1CB D0B3 E6E9 83C9 6A22

To claim this, I am signing this object:

@slogsdon
slogsdon / main.php
Created October 11, 2014 17:16
HTTP server using sockets
<?php
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die('Failed to create socket!');
socket_bind($socket, 0, 3000);
socket_listen($socket);
$msg = '<html><head><title>Hello, world!</title></head><body>Hello, world!</body></html>';
for (;;) {
if ($client = socket_accept($socket)) {
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]
else
nil
end
end
module Temp where
import System.Directory
path :: String
path = "/Users/shane.logsdon/Code/haskell/slogsdon.com/provider/posts/"
files :: IO [FilePath]
files = getDirectoryContents path
@slogsdon
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
@slogsdon
slogsdon / ServiceContainer.php
Created July 8, 2015 18:05
Basic dependency injection container for PHP
<?php
class ServiceContainer
{
private static $services;
private static $generators;
public function __construct()
{
self::$services = [];
{-#LANGUAGE OverloadedStrings #-}
module Main where
import Data.Monoid
import Data.Text (Text, pack)
import Web.Spock.Safe
main :: IO ()
main =
runSpock 3000 $ spockT id $