Skip to content

Instantly share code, notes, and snippets.

View telent's full-sized avatar

Daniel Barlow telent

View GitHub Profile
@telent
telent / gist:9742059
Last active May 8, 2024 11:36
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
"I wake up early and work hard. I think outside the box. I pay attention to detail. I overcome
limitations. I am the current World and Olympic cycling champion. Please do not hesitate to
contact me if I can be of further assistance"
--------
From: Bont Info <info@bont.com>
Date: Mon, 26 May 2014 15:42:40 +0900
Subject: Re: Bont Z skate package
To: Daniel Barlow <dan@telent.net>
sledge.core=> (defn hey [g] (* 2 g 9))
nil
sledge.core=> (def ha #'hey)
(var sledge.core/hey)
sledge.core=> (ha 2)
"Error evaluating:" (ha 2) :as "sledge.core.ha.call(null,(2));\n"
{stdenv
, fetchFromGitHub
, autoconf
, automake
, libtool
, c-ares
, popt
, openssl
, pkgconfig }:
@telent
telent / app.rb
Created January 4, 2016 07:19
puma on random port
require 'rack'
require 'puma'
def my_app
return ->(env) {
[200, {"content-type"=>"text/plain"},
["hello world"]]
}
end
(ns money-tolkien.core
(:require [reaver :as r]
[clojure.string :as str]
[clojure.xml :as xml]
[clojure.zip :as zip]))
(def tolkien-text (slurp "http://scifi.stackexchange.com/feeds/tag?tagnames=tolkien&sort=newest"))
(def money-text (slurp "https://blog.moneyadviceservice.org.uk/tag/mortgages.atom"))
# Enable CUPS to print documents.
services.printing = { enable = true; drivers = [ pkgs.hplip ]; };
services.avahi = { enable = true; nssmdns = true; };
;; As of September 2016, using the version of boot-clj that I got by following the Nix install instructions,
;; here is how I built a clojure "hello world" as a uberjar that you can run with `java -jar`. I do
;; not claim it is the right way, merely that it worked for me. This file is build.boot
(set-env!
:resource-paths #{"src"} ; may be optional?
:source-paths #{"src"} ; my code is in src/myapp/core.clj
:dependencies '[[org.clojure/clojure "1.8.0"]]) ; not sure I'm actually using this, boot may be overriding it
(task-options!
@telent
telent / gist:2b6d86cdf97ef32c2e11a42571b00cf4
Created November 2, 2016 21:05
Gotta love BT live chat
Welcome to BT, the UK's most popular Broadband provider and home of BT Sport and BT TV. You are now connected with Marco
Marco: at 20:51:40
Hi
Marco: at 20:51:40
How may I assist you with your order today?
Daniel: at 20:51:49
Hello. Am trying to order fibre broadband for a new build property and not having much luck
Marco: at 20:52:24
May I please have your Telephone Number, Postal Code and Door Number / House Name to check availability?
Daniel: at 20:52:41
diff -ur libmbim-1.14.0.orig/src/mbimcli/mbimcli-basic-connect.c libmbim-1.14.0/src/mbimcli/mbimcli-basic-connect.c
--- libmbim-1.14.0.orig/src/mbimcli/mbimcli-basic-connect.c 2016-07-05 10:20:34.000000000 +0100
+++ libmbim-1.14.0/src/mbimcli/mbimcli-basic-connect.c 2017-03-23 22:14:17.607830964 +0000
@@ -46,6 +46,7 @@
static gboolean query_subscriber_ready_status_flag;
static gboolean query_radio_state_flag;
static gchar *set_radio_state_str;
+static gboolean machine_readable_output_flag;
static gboolean query_device_services_flag;
static gboolean query_pin_flag;