Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env sh
DUNNOLOL='¯\(°_o)/¯'
echo $DUNNOLOL | tr -d '\n' | pbcopy
echo $DUNNOLOL
#!/usr/bin/env sh
SHRUG='¯\_(ツ)_/¯'
echo $SHRUG | tr -d '\n' | pbcopy
echo $SHRUG

UPDATE - Not an ecto problem

"A good bug, I mean a really good, pound-your-head-on-the-desk-for-a-week bug, is exactly like a magic trick in that something impossible appears to be happening." - Steven Frank via Daring Fireball

tl;dr The issue was that there was a Beam file for my Ecto model/struct in the root of project directory

It was a compilation timing issue. Some files were being compiled before web/models and some afterwards. Somehow an old beam file Elixir.ProjectStatus.EmailRecipient.beam had been compiled into the project root, on the 2015-06-25 with Ecto 0.12.0; in this version of Ecto the __meta__.source was a binary. The clue which, I'd seen but didn't know what to do with, was that the warning that the module was being redefined.

Compiled lib/project_status/project_recipients.ex
defmodule Fib do
def seq(n) when n >= 0, do: reverse_seq(n, [0], 1) |> Enum.reverse
defp reverse_seq(0, sequence, _next), do: sequence
defp reverse_seq(n, sequence = [last | _], next) do
reverse_seq(n - 1, [next | sequence], next + last)
end
end
@paulanthonywilson
paulanthonywilson / cheatsheet.md
Last active August 29, 2015 14:23
Spacemacs Cheatsheet

Spacemacs Cheatsheet

General

  • spc f s Save a buffer
  • spc f S Save all opened buffers
  • spc b s Open (switch) to a buffer with helm

NeoTree

require 'json'
require 'csv'
json_data = JSON.load(File.read(ARGV.first))
list_names = json_data["lists"].each_with_object({}) {|b, memo| memo[b["id"]] = b["name"]}
lists = json_data["lists"].each_with_object({}) {|b, memo| memo[b["id"]] = []}
json_data["cards"].each do |card|
list_id = card["idList"]

Keybase proof

I hereby claim:

  • I am paulanthonywilson on github.
  • I am paulwilson (https://keybase.io/paulwilson) on keybase.
  • I have a public key whose fingerprint is B513 508F 7D71 D90B 6880 F323 B0C9 6658 9D6A 24ED

To claim this, I am signing this object:

@paulanthonywilson
paulanthonywilson / interestings.md
Last active December 27, 2015 23:19
Interesting stuff from Ruby Conf 2013

Matz keynote

Matz referred to the OSS developers in the community as the "garbage collectors" (bin-men* in British English), who work to make the environment pleasant for the rest of us. Many subsequent speakers picked up on this theme.

(*) In the UK, it does also seem to be a profession with gender-diversity issues

A Peek Inside The Ruby Toolbox - Loren Segal

Ruby is well-served for tools in some areas (eg testing, deployment) but is lacking in others such as visualisation (code, execution, performance), linting, and static analysis. Those who wish to make a contribution might look there.

@paulanthonywilson
paulanthonywilson / passy.rb
Created September 24, 2011 09:41
For sites that require me to enter random numbers from my password (eg 3rd, 5th, 12th). Eg Verified with visa.
#!/usr/bin/env ruby
puts "Password please"
password = gets
loop do
puts "char number"
c = gets
break if c.strip.upcase == "Q"