Skip to content

Instantly share code, notes, and snippets.

View jamiehannaford's full-sized avatar

Jamie Hannaford jamiehannaford

View GitHub Profile
#!/bin/bash
echo "Enter your MySQL user"
read MYSQL_USER
echo "Enter your MySQL user password"
read MYSQL_PASSWD
echo "Enter your Nova VM ID"
read VM_ID
converge_aayla_secura ~ 3e9cb7b1f8644fd6bfb68abe379874de
converge_adi_gallia ~ 44d42363053a4db0a6fd32ab0e222742
converge_ajunta_pall ~ 91614f0cc283498e9fd44a82c0fa0f06
converge_atris ~ 4ef8ca88a99b4ec0bbb358d664644653
converge_atton_rand ~ 724e99d1050b41d99bfa6ef89312a45e
converge_bao-dur ~ d39fe00522f04f57a156e3154827d854
converge_bastila-shan ~ 30372fe6016c45ccac2e23e4094148d1
converge_brianna ~ 4b50e36a11bf4b9796bc7ae0e0f81603
converge_c3po ~ 3e08e278fc9746f9adb43f44241589b3
converge_count_dooku ~ e764b1ea13844a56876f277ce22af747
@jamiehannaford
jamiehannaford / point_free.hs
Last active August 29, 2015 14:02
This style of coding in which we define a function without reference to its arguments — in some sense saying what a function *is* rather than what it *does* — is known as “point-free” style.
-- starting point
fun1 :: [Integer] -> Integer
fun1 [] = 1
fun1 (x:xs)
| even x = (x - 2) * fun1 xs
| otherwise = fun1 xs
-- incorporating existing recursion patterns
fun1' :: [Integer] -> Integer
fun1' = foldr (\x acc -> (if even x then x - 2 else 1) * acc) 1
<?php
// This is the new OpenStack name
$containerName = 'Keystone';
// This is the previous OpenStack name
$objectName = 'Pillar';
require 'vendor/autoload.php';
<?php
namespace OpenStack\Common\Transport\Exception;
use GuzzleHttp\Message\RequestInterface;
use GuzzleHttp\Message\ResponseInterface;
use OpenStack\Common\Exception;
class RequestException extends Exception
{
<?php
namespace OpenStack\Common\Transport;
/**
* Describes a transport client.
*
* Transport clients are responsible for moving data from the remote cloud to
* the local host. Transport clients are responsible only for the transport
* protocol, not for the payloads.
{
"name": "openstack.compute",
"version": 2.0,
"title": "Compute service for OpenStack",
"codename": "Nova",
"schemas": {
"_comment": "These are the data structures which exist on the API",
<?php
// Method 1: Retrieve file details using HEAD
$file = $container->getObject('foo.jpg');
// Method 2: Only set the name (which is the only requirement for an update)
$file = $container->dataObject();
$file->setName('foo.jpg');
// Now update content
@jamiehannaford
jamiehannaford / irc_monitor.py
Last active August 29, 2015 13:57
Monitors an IRC channel for keywords and e-mails the respective teams with the message
import sys
import socket
import string
import re
import os
import smtplib
from email.mime.text import MIMEText
# IRC settings