Skip to content

Instantly share code, notes, and snippets.

View bradcypert's full-sized avatar
🍾
I'm now available for purchase as an NFT!

Brad bradcypert

🍾
I'm now available for purchase as an NFT!
View GitHub Profile
@bradcypert
bradcypert / default.pp
Created August 21, 2015 01:41
Dat Puppet doe.
exec { 'update_packages':
command => 'apt-get update',
path => '/usr/bin',
}
# Install Leiningen to run tests and build project
exec { 'get_leiningen':
command => '/usr/bin/wget https://raw.github.com/technomancy/leiningen/stable/bin/lein -O /usr/bin/lein && /bin/chmod a+x /usr/bin/lein',
unless => '/usr/bin/which lein &>/dev/null',
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# We're using an Ubuntu box from Puppet Labs with Puppet already installed
config.vm.box = "ubuntu-puppetlabs"
(ns hatchery-service.models.media
(:use korma.core)
(:require [hatchery-service.entities :as entity]))
(defn find-all []
(select entity/media))
(defn find-by [field value]
(first
(select entity/media
{
"name": "larva",
"version": "0.0.0",
"description": "Small description for larva goes here",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
@bradcypert
bradcypert / sample.js
Last active September 23, 2015 01:21
(function(){
return {
bigInt: require('json-bigint');
}
})();
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
(ns hello-world.handler)
(defn main [] (println "Hello World")
require '../vendor/autoload.php';
require '../src/models/dev.php';
$container = new \Slim\Container;
$container['db'] = function ($container) {
$capsule = new \Illuminate\Database\Capsule\Manager;
$capsule->addConnection($container['settings']['db']);
$capsule->setAsGlobal();
function gau
git status --short --untracked-files=no | grep "M " | cut -c4- | xargs git add
end
(spec/def ::auth-user int?)
(spec/def ::id string?)
(spec/def ::rating string?)
(spec/def ::rate-podcast-spec (spec/keys :req-un [::auth-user ::id ::rating]))
(defn- rate-podcast
[params]
(if (spec/valid? ::rate-podcast-spec params)
(let [user (:auth-user params)
podcast (Integer/parseInt (:id params))