Skip to content

Instantly share code, notes, and snippets.

View ciarand's full-sized avatar

Ciaran Downey ciarand

View GitHub Profile
@ciarand
ciarand / keybase.md
Created October 21, 2014 20:08
Keybase verification

Keybase proof

I hereby claim:

  • I am ciarand on github.
  • I am ciarand (https://keybase.io/ciarand) on keybase.
  • I have a public key whose fingerprint is 5E92 46D3 787F E923 7078 E31B 3660 D256 53E9 2505

To claim this, I am signing this object:

@ciarand
ciarand / traitTest.php
Created October 10, 2014 20:28
testing traits
<?php
// your test class goes here
// dummy class:
class DummyTimeSinceCreated
{
use TimeSinceCreatedTrait; // make sure to import it via a “use” statement at the top of the file
protected $created_at;
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"io/ioutil"
"net/http"
"os"
@ciarand
ciarand / index.html
Created September 1, 2014 21:47
experiments with websockets and app.net
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>socketdotnet</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@ciarand
ciarand / result.php
Last active August 29, 2015 14:04
Playing around with creating an intuitive API for Result-type objects (i.e. Failure / Success wrappers) and their interactions w/ Exceptions
<?php
abstract class Result
{
public static function fromValue($value, $reject = null)
{
return ($value !== $reject) ? new Success($value) : new Failure;
}
public static function failOnException($callback)
@ciarand
ciarand / bootstrap_coreos_on_linode_debian.sh
Created July 25, 2014 23:22
Bootstrap a Debian 7.5 Linode server w/ CoreOS
# sources:
# - http://stackoverflow.com/questions/24585419/
# - https://coreos.com/docs/running-coreos/bare-metal/installing-to-disk/
# - https://www.linode.com/docs/platform/custom-kernels-distros/run-a-distributionsupplied-kernel-with-pvgrub
set -e -o pipefail
apt-get update -y
apt-get upgrade -y --show-upgraded
mkdir /boot/grub
@ciarand
ciarand / lol.bash
Last active August 29, 2015 14:03
How do I even indent this correctly
# move all the front-end assets into a public dir
find . -type f \( \
-name "*.css" -o \
-name "*.html" -o \
-name "*.js" -o \
-name "robots.txt" -o \
-name "humans.txt" -o \
-name "favicon.ico" -o \
-name ".htaccess" \) |
while read file
@ciarand
ciarand / SnapshotCommand.php
Created June 23, 2014 03:18
A simple Artisan command to echo the response from a given route
<?php
use Illuminate\Console\Command;
use Illuminate\Foundation\Testing\Client;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class SnapshotCommand extends Command
{
/**
@ciarand
ciarand / getting_started_with_hugo.bash
Created June 22, 2014 15:31
getting_started_with_hugo.bash
wget https://github.com/spf13/hugo/releases/download/v0.11/hugo_0.11_linux_386.tar.gz
tar xvzf hugo_0.11_linux_386.tar.gz
mv hugo_0.11_linux_386/hugo_0.11_linux_386 hugo
chmod +x ./hugo
./hugo new site blah
echo "your new site is in 'blah'"
@ciarand
ciarand / pointers.c
Created June 17, 2014 23:12
trouble with pointers dot c
#include <stdio.h>
#include <stdlib.h>
#define LINE_LENGTH 1024
int get_line_with_prefix_from_file(const char* prefix, FILE* file, char* result_buf) {
char line_buf[LINE_LENGTH];
int matches = 0;
while (fgets(line_buf, LINE_LENGTH, file)) {