Skip to content

Instantly share code, notes, and snippets.

View philippkueng's full-sized avatar

Philipp Küng philippkueng

View GitHub Profile
require 'dnsimple'
require 'platform-api'
namespace :staging do
desc "create subdomain DNS record for Heroku review app"
task :publish_dns do
heroku_app_name = ENV['HEROKU_APP_NAME']
heroku_app_name =~ /.*(pr-\d+)/
subdomain = $1
@philshem
philshem / get_geo.py
Last active January 13, 2018 15:34
Source code for "Switzerland Tweets" dataviz
# -*- coding: utf-8 -*-
import glob
import json
import requests
delim = '\t'
def get_language(tweet,lang_dict):
@mheadd
mheadd / outbound-node.js
Created December 10, 2010 19:13
A simple Node.js script to send SMS messages through the Tropo platform.
/**
* Simple outbound message launcher in Node.js
*
* You will need to have a Tropo scripting aplication set up
* to use this. See sample code below:
*
* message(msg, { to:number, network:"SMS" });
*
* Save this file in your Tropo account as message.js
*
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
;; or `spacemacs'. (default 'spacemacs)
dotspacemacs-distribution 'spacemacs
;; Lazy installation of layers (i.e. layers are installed only when a file
@comnik
comnik / policing.clj
Created June 25, 2018 22:22
Applying access policies to Datomic queries.
(require '[datomic.api :as d])
(def uri "datomic:mem://policing")
(d/create-database uri)
(def conn (d/connect uri))
;; We are managing classified documents.
(def schema
[{:db/ident :level/rank
var sys = require('sys'),
http = require('http'),
redis = require("./redisclient");
var queuedRes = {}
var counter = 1;
http.createServer(function (req, res) {
pushOnQueue(req, res);
}).listen(8000);
@Luzifer
Luzifer / README.md
Last active August 25, 2019 12:34
Strategies for persistent data storage on CoreOS-cluster

Persistent data storage on CoreOS-cluster

Storing the data on the host machine

Data directories are created in /home/coreos and mounted into the container using volume cli options of docker run. All data the container writes is stored on the host and as long as the host persists safe against container restarts / recreates.

  • Pro
    • No effort, just create the directories and mount them into the container
  • Contra
  • Container is bound to host (unable to failover)
@ordnungswidrig
ordnungswidrig / microweb.cljs
Created December 10, 2019 11:12
Webserver in clojurescript on espruino
(set! *warn-on-infer* true)
(def ^js wifi (js/require "Wifi"))
(def ^js http (js/require "http"))
(def n (atom 0))
(defn build-response []
(str
"<html>"
@joelittlejohn
joelittlejohn / find-unused-clj.sh
Last active November 6, 2020 16:56
Very quick and dirty command to find unused functions and vars in a Clojure project
#!/bin/bash
for f in $(egrep -o -R "defn?-? [^ ]*" * --include '*.clj' | cut -d \ -f 2 | sort | uniq); do
echo $f $(grep -R --include '*.clj' -- "$f" * | wc -l);
done | grep " 1$"
@lspector
lspector / notes.clj
Created February 4, 2014 17:23
Minimal example of how to play a melody using Clojure/Overtone/Leipzig
;; Minimal example of how to play a melody using Clojure/Overtone/Leipzig, based on code
;; at https://github.com/ctford/leipzig
;; by Lee Spector, lspector@hampshire.edu, 20140204
;; Add the following to your dependencies in project.cl, and do "lein deps" if your environment requires it:
;; [leipzig "0.7.0"]
(ns notes.core
(:use [leipzig melody scale live]