Skip to content

Instantly share code, notes, and snippets.

View joshuacalloway's full-sized avatar

joshua calloway joshuacalloway

View GitHub Profile
@joshuacalloway
joshuacalloway / Dockerfile
Created August 8, 2014 21:06
Using --volumes-from does not work when using the -H flag. Trying to spin off docker containers on host from within a docker container.
from ubuntu:14.04
run apt-get update
run apt-get install -y docker.io
run ln -sf /usr/bin/docker.io /usr/local/bin/docker
add run.sh /usr/local/bin/run
entrypoint ["/usr/local/bin/run"]
@joshuacalloway
joshuacalloway / cloud-config
Last active August 29, 2015 14:04
cloud-config
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfAoOymBIL1VuLdaYmyj5NiSUADcodl0Q61LjZ5Et8xCdww/TqeYKY5mcsza1A3XTDKqM9gDqzkRHzCSolh/nTOh5RoEjgJnyTIFlVgz85N2N6ylh0urWf4WGZkqSzutKmzXU9bo/rnqWbJXVahBY+99rt+27aVl2i9Qbft4CFDxHrwHrphLyrwEPIJeBdOT9fivU0d/4uvhnaR2FEyolW38pmKOy5coJmAQXWJXVePJQ5vc7jiqt9IKgYqa6mjpPsblgaOLOhi8aArrA/luHd3bJ6QQ9C4UPX9JyZKId+dvPFzqdEvx/nLSX881p0ekFGFI9+pkXpnHIDY9t21OgR
groups:
coreos:
fleet:
public-ip: 10.32.219.85
metadata: env=alpha
etcd:
@joshuacalloway
joshuacalloway / baseVagrantfile
Last active August 29, 2015 14:02
base Vagrantfile - for stackoverflow question
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos6.5"
config.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box"
config.vm.post_up_message = "vagrant ssh - will log you into the machine\nvagrant package --base base --output ../base.box - will create a retel-base vagrant box"
config.vm.provider :virtualbox do |v, override|
v.name = "base"
end
@joshuacalloway
joshuacalloway / eulerproblem19
Created May 30, 2014 01:04
euler problem 19
(ns euler.problem19)
(defn isleapyear?[yr]
(and (not (zero? (mod yr 100))) (= 0 (mod yr 4))))
(def nonleapmonths [31 28 31 30 31 30 31 31 30 31 30 31])
(def leapmonths [31 29 31 30 31 30 31 31 30 31 30 31])
(defn getfirstmonthdays [yr]
(loop [index 0
@joshuacalloway
joshuacalloway / C#ReliableTCPDuplexCallback
Created July 31, 2012 05:10
C# reliable TCP duplex callback
in ou project we use the following Binding and works perfectly.
<netTcpBinding>
<binding name="netTcpBinding"
receiveTimeout="Infinite">
<reliableSession inactivityTimeout="00:00:10"
enabled="true" />
</binding>
</netTcpBinding>
This is equal to the following code
@joshuacalloway
joshuacalloway / xsl_to_csv_example1
Created July 15, 2012 03:07
xsl example convert xml and child nodes to csv file
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="Invoice">
<xsl:for-each select="Item_List/Item">
<xsl:apply-templates select="/Invoice/*[not(self::Item_List) and not(self::TouchLess)]" />
<xsl:apply-templates select="/Invoice/TouchLess"/>
@joshuacalloway
joshuacalloway / play20_money format
Created May 26, 2012 01:13
play framework 2.0 , so that you can use "money" format in your Forms
package helpers
import play.api.data._
import play.api.data.format._
import java.math.BigDecimal
import play.api.data.format.Formats._
import play.api.data.Forms._
@joshuacalloway
joshuacalloway / .emacs
Created December 2, 2010 22:12
my working .emacs
;; in git, version 1
(server-start)
(tool-bar-mode 0)
(menu-bar-mode 0)
(add-to-list 'load-path "~/.emacs.d")
(require 'emacslocal)
(require 'recentf)
(recentf-mode 1)
(require 'google-search)