Skip to content

Instantly share code, notes, and snippets.

View rramsden's full-sized avatar
♨️
Keep On Keeping On

Richard Ramsden rramsden

♨️
Keep On Keeping On
View GitHub Profile
@rramsden
rramsden / main.kt
Last active March 27, 2020 05:45 — forked from anny0739/main.kt
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
import kotlin.experimental.and
fun main(args: Array<String>) {
val hmacFromKomoju = "06cb40bd7c630613e41f874296eddd0153d023857a76a9de52daad5da6c2bbe4"
val algorithm = "HmacSHA256"
### Keybase proof
I hereby claim:
* I am rramsden on github.
* I am rramsden (https://keybase.io/rramsden) on keybase.
* I have a public key ASA50FKvBjy4ixWdfLHGoAVrKyZLuU_uxVIhH6YHK7BHjAo
To claim this, I am signing this object:
@rramsden
rramsden / KomojuAPI.cs
Last active January 5, 2016 01:50
Komoju API C#, ASP.NET
// Creating a payment using JSON API
// See https://docs.komoju.com/api/overview#payments
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Collections.Specialized;
public class HelloWorld
v0.11.0
-------
defmodule A do
def :!.() do
"bang!"
end
end
{:module, Test, .....}
# http://elixir-lang.org/docs/stable/Module.html#moduledoc
defmodule M do
@before_compile __MODULE__
defmacro __before_compile__(_env) do
quote do
def hello, do: "world"
end
end
defmodule Test do
Enum.each ["a", "b", "c"], fn(name) ->
def unquote(name) do
"works"
end
end
end
IO.puts Test.a
Compiled lib/elixir/lib/stream.ex
Compiled lib/elixir/lib/string/chars.ex
Compiled lib/elixir/lib/supervisor/behaviour.ex
Compiled lib/elixir/lib/string.ex
Compiled lib/elixir/lib/system.ex
Compiled lib/elixir/lib/tuple.ex
Compiled lib/elixir/lib/uri.ex
Compiled lib/elixir/lib/version.ex
make[1]: Entering directory `/opt/erlang/elixir'
==> unicode (compile)
class UsersController < ApplicationController
requires_authentication [:index, :show]
def index
@users = User.order(:id)
respond_to do |format|
format.html
format.csv { send_data @users.to_csv }
format.xls # { send_data @users.to_csv(col_sep: "\t") }
end
@rramsden
rramsden / gist:4377517
Created December 26, 2012 03:00
brew formula output brew install -vd --with-wxgtk erlang
λ (rramsden@richard) gdk-pixbuf-2.26.2 brew install -vd --with-wxgtk erlang
/usr/local/bin/brew: loading /usr/local/Library/Formula/erlang.rb
Warning: Your Xcode (4.4) is outdated
Please install Xcode 4.4.1.
/usr/local/bin/brew: loading /usr/local/Library/Formula/automake.rb
/usr/local/bin/brew: loading /usr/local/Library/Formula/autoconf.rb
/usr/local/bin/brew: loading /usr/local/Library/Formula/libtool.rb
/usr/local/bin/brew: loading /usr/local/Library/Formula/wxgtk.rb
/usr/local/bin/brew: loading /usr/local/Library/Formula/gtk+.rb
nnoremap <buffer> <localleader>s :rightbelow vsplit<CR>:execute 'normal! /^' . expand('<cword>') . "\<cr>"<cr>:nohlsearch<cr>