I hereby claim:
- I am chrisfarms on github.
- I am chrisfarms (https://keybase.io/chrisfarms) on keybase.
- I have a public key ASDaE75jPl2n3qQPaB7TUu81ZrH2KVczT8TUir6eNTDdYQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| CREATE OR REPLACE FUNCTION time_ago_in_words(timestamp with time zone) | |
| RETURNS text | |
| LANGUAGE SQL | |
| AS $$ | |
| SELECT CASE | |
| WHEN date_part('year', age(current_timestamp, $1)) = 1 THEN concat(date_part('year', age(current_timestamp, $1)), ' year ago') | |
| WHEN date_part('year', age(current_timestamp, $1)) > 1 THEN concat(date_part('year', age(current_timestamp, $1)), ' years ago') | |
| WHEN date_part('month', age(current_timestamp, $1)) = 1 THEN concat(date_part('month', age(current_timestamp, $1)), ' month ago') | |
| WHEN date_part('month', age(current_timestamp, $1)) > 1 THEN concat(date_part('month', age(current_timestamp, $1)), ' months ago') | |
| WHEN date_part('day', age(current_timestamp, $1)) = 1 THEN concat(date_part('day', age(current_timestamp, $1)), ' day ago') |
| {config, pkgs, ...}: | |
| { | |
| imports = [ | |
| ../virtualisation/guests.nix | |
| ]; | |
| virtualisation.guests = { | |
| red1 = { |
| { config, pkgs, ... }: | |
| let | |
| srcDir = builtins.toString ./.; | |
| dataDir = "/var/data/"; | |
| mysqlpass = "v3rys3cr3t"; | |
| in { | |
| system.activationScripts.uploadsDir = '' | |
| mkdir -p "${dataDir}" | |
| chown -R wwwrun:wwwrun "${dataDir}" |
| let | |
| pkgs = import <nixpkgs> {}; | |
| stdenv = pkgs.stdenv; | |
| in | |
| { | |
| developmentEnv = stdenv.mkDerivation rec { | |
| name = "developmentEnv"; | |
| version = "nightly"; | |
| src = ./.; | |
| buildInputs = [ |
| #!/bin/bash | |
| # Author: slowpoke <proxypoke at lavabit dot com> | |
| # | |
| # Copying and distribution of this file, with or without modification, | |
| # are permitted in any medium without royalty provided the copyright | |
| # notice and this notice are preserved. This file is offered as-is, | |
| # without any warranty. | |
| # | |
| # A pre-commit hook for go projects. In addition to the standard |
| package main | |
| import ( | |
| "fmt"; | |
| "io" | |
| "xml" | |
| "strings" | |
| ) |
| package main | |
| import ( | |
| "fmt" | |
| "http" | |
| "time" | |
| ) | |
| type Site struct { | |
| url string |
| #!/usr/bin/env python | |
| import getopt | |
| import os | |
| import ae | |
| import sys | |
| import code | |
| def usage(): | |
| print """ |
| ###################################################### | |
| # allow scripts to use appengine apis | |
| # | |
| # assumes you store your data in a "data" directory | |
| # in your app directory. See connect_local_datastore() | |
| # and assumes that you have a HRD app id with "~" | |
| ###################################################### | |
| # | |
| # locate app-engine SDK: | |
| AE_PATH = "/your/path/to/sdk/google_appengine/" |