Skip to content

Instantly share code, notes, and snippets.

View paulbellamy's full-sized avatar

Paul Bellamy paulbellamy

View GitHub Profile
@robphoenix
robphoenix / spacemacs-cheshe.md
Last active February 6, 2024 23:11
[DEPRECATED] Spacemacs Cheat Sheet - Visit https://github.com/Ben-PH/spacemacs-cheatsheet

This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
@philandstuff
philandstuff / euroclojure2014.org
Last active February 19, 2024 05:12
Euroclojure 2014

EuroClojure 2014, Krakow

Fergal Byrne, Clortex: Machine Intelligence based on Jeff Hawkins’ HTM Theory

  • @fergbyrne
  • HTM = Hierarchical Temporal Memory
  • Slides

big data

  • big data is like teenage sex
    • noone knows how to do it
    • everyone thinks everyone else is doing it
@cridenour
cridenour / gist:74e7635275331d5afa6b
Last active August 7, 2023 13:52
Setting up Vim as your Go IDE

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

@jyap808
jyap808 / encrypt_decrypt_gpg_armor.go
Created January 4, 2014 01:12
Symmetrically encrypting a string into ASCII armored GPG format and then Decrypting it in Golang
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"code.google.com/p/go.crypto/openpgp/armor"
"fmt"
"io/ioutil"
"log"
)
@fsmunoz
fsmunoz / mqtt.clj
Created June 23, 2013 09:46
Simple example of MQTT message publishing using Clojure and the Eclipse Paho libraries
;; Simple example of MQTT message publish using Clojure
;;
;; Uses the Websphere Eclipse Paho client
;;
;; Author: Frederico Munoz <frederico.munoz@pt.ibm.com>
;; Date: 18-Jun-2013
;; Keywords: mqtt, messaging, m2m, telemetry, clojure, iot, paho
;;
;; Copying and distribution of this file, with or without modification,
;; are permitted in any medium without royalty provided the copyright
anonymous
anonymous / pipe.clj
Created December 18, 2012 12:49
(defn pipe
"Returns a vector containing a sequence that will read from the
queue, and a function that inserts items into the queue.
Source: http://clj-me.cgrand.net/2010/04/02/pipe-dreams-are-not-necessarily-made-of-promises/"
[]
(let [q (LinkedBlockingQueue.)
EOQ (Object.)
NIL (Object.)
s (fn queue-seq []
@ptaoussanis
ptaoussanis / free-port.clj
Created December 14, 2012 06:28
A little utility to allow simple redeployment of Clojure web servers with zero downtime, and without the need for a proxy or load balancer. Just wrap any port-binding calls, and the utility will auto kill pre-existing servers as necessary. *nix only. Based on the blog post by Feng Shen, http://shenfeng.me/fast-restart-clojure-webapp.html
;; (require '[clojure.string :as str] '[clojure.java.shell :as shell] '[taoensso.timbre :as timbre])
(defn with-free-port!
"Attempts to kill any current port-binding process, then repeatedly executes
nullary `bind-port!-fn` (which must return logical true on successful
binding). Returns the function's result when successful, else throws an
exception. *nix only.
This idea courtesy of Feng Shen, Ref. http://goo.gl/kEolu."
[port bind-port!-fn & {:keys [max-attempts sleep-ms]
@nbogie
nbogie / whereami-readable.txt
Created July 1, 2011 09:17
presentation of https://gist.github.com/1056734 for attempted readability
echo -n
#quote-escaping removed from the following json
"
{"version": "1.1.0","host": "maps.google.com","request_address": true,"address_language": "en_GB", "wifi_towers":
[
`iwlist scan 2> /dev/null |
tr -d '\n' |
sed -e 's/Cell [0-9]* - Address: \([0-9A-Z:]*\)[^C]*Channel:\([0-9]*\)[^S]*Signal level=\([0-9-]*\) dBm[^E]*E[^E]*ESSID:"\([^"]*\)"/\{"mac_address": "\1","signal_strength": \3,"age": 0,"channel": \2,"ssid": "\4"}/g'
-e 's/[^{]*{/{/'
-e 's/}[^{]*{/},{/g'