Skip to content

Instantly share code, notes, and snippets.

View Elzair's full-sized avatar

Philip Woods Elzair

View GitHub Profile
@Elzair
Elzair / build-err.txt
Last active August 14, 2017 15:26
work-sharing-threadpool-help
Compiling playground v0.0.1 (file:///playground)
error[E0308]: mismatched types
--> src/main.rs:62:23
|
62 | mem::swap(datum1.unwrap().1.borrow_mut(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &mut _, found struct `std::cell::RefMut`
|
= note: expected type `&mut _`
found type `std::cell::RefMut<'_, std::sync::mpsc::Receiver<bool>>`
= help: try with `&mut datum1.unwrap().1.borrow_mut()`
@Elzair
Elzair / engine-extract.sh
Last active March 15, 2017 09:24
Unvanquished history merge
#!/bin/sh
PWD=$(pwd)
FORK_COMMIT="ca388dc0c6bac110254a4e5a175abbb7963b1f4f"
FORK_DATE="Wed Jul 15 22:04:42 2015 +100"
if [ ! -d "Unvanquished" ]
then
echo -e "Cloning full repository"
git clone https://github.com/Unvanquished/Unvanquished.git Unvanquished
@Elzair
Elzair / git-extract-subdir
Created July 28, 2016 17:13
git-extract-subdir
#!/usr/bin/env ruby
require 'fileutils'
require 'optparse'
require 'ostruct'
require 'pathname'
require 'pp'
$verbose = false
@Elzair
Elzair / jitsu-error-01.txt
Created July 12, 2013 18:07
Error output from **jitsu deploy**
info: Welcome to Nodejitsu Elzair
info: jitsu v0.12.11, node v0.9.9
info: It worked if it ends with Nodejitsu ok
warn: You are using unstable version of node.js. You may experience problems.
info: Executing command deploy
info: Analyzing application dependencies in node app.js
info: Creating snapshot 0.6.1
info Uploading: [== ] 11%error: Error running command deploy
error: socket hang up
info: The nodejitsu api reset the connection
@Elzair
Elzair / idx.jl
Created March 10, 2015 01:22
Julia IDX Parser
import Base.ntoh
@vectorize_1arg Number Base.ntoh
function readIdx(file_name)
fs = open(file_name, "r")
magic_number = read(fs, UInt8, 4)
if magic_number[3] == 0x08
idx_type = UInt8
elseif magic_number[2] == 0x09
@Elzair
Elzair / hannahci-notes.org
Last active August 29, 2015 14:14
hannahci presentation

Hannah: Comparmentalizing Deployment

Hi, my name is Philip Woods, and I am here today to talk about Hannah.

What is Hannah?

First of all, what is Hannah?

To put it simply, Hannah provides Continuous Integration and Continuous Deployment.

@Elzair
Elzair / preinstall-hannahci-ubuntu.sh
Last active August 29, 2015 14:14
preinstall-hannahci-ubuntu
#!/bin/sh
apt-get install -y build-essential libgmp zlib1g
curl -sSL https://get.docker.com/ubuntu/ | sudo sh -
@Elzair
Elzair / haskell-notes.org
Last active August 29, 2015 14:13
Haskell Notes

Functors

Definition

class Functor f where
  fmap :: (a -> b) -> f a -> f b

Laws

@Elzair
Elzair / scotty.hs
Created January 19, 2015 13:03
sample-scotty-app
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mconcat)
import Network.Wai.Middleware.Static
import Web.Scotty
main = scotty 3000 $ do
middleware $ staticPolicy (noDots >-> addBase "static")
get "/" $ file "static/index.html"
get "/:word" $ do
@Elzair
Elzair / config.hs
Last active August 29, 2015 14:13
yaml-parser
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Config (
MyConfig,
RepositoryConfig,
BranchConfig,
HostConfig,
readConfig
) where