Skip to content

Instantly share code, notes, and snippets.

@ciaranarcher
ciaranarcher / gist:5151631
Last active December 14, 2015 21:29
Redis Stuff
redis_client.set('ciaran_key', [:hi, :there].to_json)
>> OK
JSON.parse(redis_client.get('ciaran_key'))
>> ["hi", "there"]
redis_client.del('ciaran_key')
>> 1
@ciaranarcher
ciaranarcher / .rvmrc
Created April 15, 2013 08:32
Example `.rvmrc` file
rvm 1.9.3-p327; rvm gemset use ciaran_gemset
@ciaranarcher
ciaranarcher / .my.cnf
Created April 16, 2013 08:21
Sample MySQL Configuration Example
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

Some vim-go tips

  • gd jumps to the definition of a type, variable
  • C-t jumps you back to where you where.
  • Use <tab> to autocomplete snippets in insert mode. Example snippets.
  • :A open alternate (i.e. test for current file). Also :AH and :AV for horizontal and vertical splits.
  • gt will run the tests for the current file.
  • :GoDeclsDir will show all functions in current directory.
  • K open GoDoc for symbol under the cursor.
  • <leader>i over a function or method name will show function information.
  • c will run GoCoverage for the current file.
We couldn’t find that file to show.
@ciaranarcher
ciaranarcher / sublime_shortcuts.md
Last active February 18, 2016 08:25
Sublime Text 2 Shortcuts
@ciaranarcher
ciaranarcher / output.txt
Created June 5, 2013 20:21
Heroku Lineman Build Details
ember-movies master$ git push heroku master
Counting objects: 384, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (346/346), done.
Writing objects: 100% (384/384), 728.08 KiB | 329 KiB/s, done.
Total 384 (delta 150), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Lineman app detected
@ciaranarcher
ciaranarcher / sample.clj
Created January 13, 2014 19:58
Concatenate any number of files
(defn cat-many [out files]
(map #(with-open [o (io/output-stream out)]
(io/copy (io/file %) o)) files))
(cat-many "/tmp/ciaran.mp3" '("/tmp/test-recording-1.mp3" "/tmp/test-recording-2.mp3"))
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) (z float64) {
z = 1.0
for i := 0; i < 100000000; i++ {
@ciaranarcher
ciaranarcher / golang-cheat.md
Last active December 27, 2018 14:26
golang cheatsheet

Types

type Vertex struct {
    Lat, Long float64
}

Maps