Each section should be run as the user or as root, pay attention to which one!
As $USER
curl https://nixos.org/nix/install | sh
; Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/ | |
; in project.clj dependencies | |
; [com.impossibl.pgjdbc-ng/pgjdbc-ng "0.5"] | |
(ns pglisten.core | |
(:import [com.impossibl.postgres.jdbc PGDataSource] | |
[com.impossibl.postgres.api.jdbc PGNotificationListener])) |
package main | |
import ( | |
"fmt" | |
"github.com/alexedwards/stack" | |
"github.com/julienschmidt/httprouter" | |
"net/http" | |
) | |
func main() { |
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
The MIT License (MIT) | |
Copyright (c) 2014 Tomas Kafka | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
module Hedis | |
( | |
-- * Application classes | |
HasRedis(..) | |
-- * App-wrapped redis runner | |
, redis | |
-- * Re-export other stuff from "Database.Redis" | |
, module R | |
) where |
These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf https://twitter.com/thomasf This is how i used it on a Debian Wheezy testing (https://www.debian.org/releases/testing/)
Discuss, ask questions, etc. here https://news.ycombinator.com/item?id=7445545
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
var WebSocketServer = require('ws').Server; | |
var wss = new WebSocketServer({port: 8080}); | |
var jwt = require('jsonwebtoken'); | |
/** | |
The way I like to work with 'ws' is to convert everything to an event if possible. | |
**/ | |
function toEvent (message) { | |
try { |