Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am chendrix on github.
  • I am chendrix ( on keybase.
  • I have a public key ASA5IuuJ733Dgr_LnPUADS9Av05zba5d4yPbCJ1N6aZAbwo

To claim this, I am signing this object:

chendrix / build-and-test.yml
Created June 21, 2017 22:53
How to use docker-image-resource to build custom docker images used as inputs for later tasks
View build-and-test.yml
- name: build-and-test
- task: build-image
privileged: true
platform: linux
type: docker-image
chendrix / RandomMatrix.elm
Last active August 29, 2015 14:26
Random Matrix in Elm
View RandomMatrix.elm
import Random exposing (list, int)
import Array exposing (fromList)
import Maybe
type alias Matrix a = Array.Array (Array.Array a)
type alias Location = (Int, Int)
row : Location -> Int
row = fst
col : Location -> Int
col = snd
chendrix / TodoMe.elm
Created May 17, 2015 17:37
Bug somewhere?
View TodoMe.elm
module TodoMe where
{-| TodoMVC implemented in Elm, using plain HTML and CSS for rendering.
This application is broken up into four distinct parts:
1. Model - a full definition of the application's state
2. Update - a way to step the application state forward
3. View - a way to visualize our application state with HTML
4. Inputs - the signals necessary to manage events
chendrix / minefield.rb
Last active August 29, 2015 14:14
Multiple constructors
View minefield.rb
class Minefield
def initialize(map)
@map = map
def self.initialize_with_random_mines(size: , mine_count:)
map = { { } }
mine_count.times do |_|
row = rand(size)
chendrix / prelude.hs
Created September 18, 2014 06:00
"Policy" implementation in haskell
View prelude.hs
module Policy where
import Data.List
type Reason = String
type Reasons = [Reason]
data Policy = Invalid Reasons | Valid
instance Show Policy where
show Valid = "Valid"
show (Invalid reasons) = "Invalid: " ++ (intercalate ". " reasons) -- intercalate == Ruby's join
chendrix / Gemfile
Last active April 12, 2023 00:35
Namecheap API
View Gemfile
# ... rest of gemfile
gem 'httparty'
gem 'nokogiri'
chendrix / post_demo.php
Created May 16, 2011 08:29
Displaying data sent via a node curl call in PHP
View post_demo.php
$ node test.js
stringified post: your=post&data=goes%20here
curl -d "your=post&data=goes%20here" -s "http://localhost:8888/post_demo.php"
stdout: post goes here