Skip to content

Instantly share code, notes, and snippets.

Avatar
☯️
I have either forgot how to write code, or I am a master. One of the two.

Jamie Curle jamiecurle

☯️
I have either forgot how to write code, or I am a master. One of the two.
View GitHub Profile
@jamiecurle
jamiecurle / challenges.md
Last active Feb 6, 2019 — forked from aymanosman/challenges.md
interview #1 questions
View challenges.md

Fizzbuzz

1
2
Fizz
4
Buzz
Fizz
7
8
View gist:6507065
Thursday, September 5, 2013
On the NSA
Let me tell you the story of my tiny brush with the biggest crypto story of the year.
A few weeks ago I received a call from a reporter at ProPublica, asking me background questions about encryption. Right off the bat I knew this was going to be an odd conversation, since this gentleman seemed convinced that the NSA had vast capabilities to defeat encryption. And not in a 'hey, d'ya think the NSA has vast capabilities to defeat encryption?' kind of way. No, he'd already established the defeating. We were just haggling over the details.
Oddness aside it was a fun (if brief) set of conversations, mostly involving hypotheticals. If the NSA could do this, how might they do it? What would the impact be? I admit that at this point one of my biggest concerns was to avoid coming off like a crank. After all, if I got quoted sounding too much like an NSA conspiracy nut, my colleagues would laugh at me. Then I might not get invited to the cool security parties.
All of this is a
View keybase.md

Keybase proof

I hereby claim:

  • I am jamiecurle on github.
  • I am sopost_jamie (https://keybase.io/sopost_jamie) on keybase.
  • I have a public key ASBWKiX_MOGauJh2r3djPRY-Xov8Ai39STow0tVVtCDBvQo

To claim this, I am signing this object:

View foo.exs
defmodule Foo do
@doc """
Returns sum of items in a list
"""
def sum(list), do: _sum(list, 0)
defp _sum([], acc), do: acc
defp _sum([h|t], acc), do: _sum(t, h + acc)
@doc """
View ral.py
import csv
ral_for_sale = [ "RAL7035", "RAL7038", "RAL7036", "RAL7030", "RAL7037", "RAL7015", "RAL9005", "RAL8017", "RAL1016", "RAL1021", "RAL1004", "RAL2008", "RAL3017", "RAL3000", "RAL3003", "RAL3005", "RAL6027", "RAL6034", "RAL6019", "RAL6033", "RAL6020", "RAL6012", "RAL6005", "RAL5014", "RAL5022", "RAL5024", "RAL5002", "RAL5010", "RAL9001", "RAL1013", "RAL1015", "RAL9002"]
with open("ral.csv", "r") as csv_file:
ral_reader = csv.reader(csv_file)
rals = [(row[0].replace(" ", ""), row[2]) for row in ral_reader]
# filter out the ones that we have
available = {x[0]: x[1] for x in filter(lambda x: x[0] in ral_for_sale, rals)}
View gist:44bbdaf926498b5538258d6009f17cc4
ids = ["0a7ce220-e0bc-42c6-9ffd-89a300385290", "69436dd8-2d35-4162-8ca1-2ee14ddf5b60", "b3b0ca6f-ecce-402b-9331-8df2d5f7f7dc", "be5f1bf1-2711-4df0-902b-25a0e241ac14", "74d72810-58cd-49e4-b9ff-8d95fd014a19", "871a7a93-47d8-4ee2-a9d1-c582da3737a4", "98a7694b-0527-47e9-b2ec-88e74af3aed7", "a099d396-6745-44e3-9811-8630ab292857", "a53d5a64-40ae-4859-b4fa-41cf4739430e", "b058f5fb-cf8b-4e45-930b-f1e7a5b98a62", "18c779e9-f33f-462e-b505-4f0c55fe4f3a", "03dc5e62-dcc9-4ba4-a975-57d6a52786b4", "7a0c32de-30dd-4483-913b-01213748e47b", "5aa8b35f-6fc3-4d85-84f5-fd4b3cf87cc6", "a0e0acd2-67bb-4f35-8442-c67aaec31401", "17a16235-ca62-4e32-8a50-bd4b323c5a87", "5a7dc756-01f5-49da-8d07-a503c899fc02", "8964d310-f6dc-46a9-a54e-38d49661b3a4", "3bc3beca-c493-40e1-9546-346a71eea80a", "1ba0ce61-e83c-4fc3-92d6-eb2a2dd0a62c", "739bcf1e-d4eb-413c-9766-37158a8b41db", "6a0e9235-3446-4e10-b11c-f3c1074fdb76", "e4b2b71c-e3d7-484e-8ad6-15c0eb77d53c", "c41e9a1a-602c-4347-8b51-86ca0171232d", "d2f649eb-be8d-4533-8a7b-9bef41e48000", "f7b6a527-9408-44
View thing.sh
head -200 /dev/urandom | cksum | md5
View gist:a8b83d064d40a0677a230d6775e931df
### Keybase proof
I hereby claim:
* I am jamiecurle on github.
* I am jamiecurle (https://keybase.io/jamiecurle) on keybase.
* I have a public key whose fingerprint is 6459 5664 83AC A299 4AD4 0819 D603 9AAD C583 B150
To claim this, I am signing this object:
@jamiecurle
jamiecurle / adder.ex
Created Apr 16, 2016
most basic adding GenServer in Elixir
View adder.ex
defmodule Adder do
use GenServer
def handle_call({:add, x, y}, _from, []) do
{:reply, x + y, []}
end
end
@jamiecurle
jamiecurle / nginx.conf
Created Nov 10, 2013
Nginx SSL config for proxying to jenkins
View nginx.conf
upstream jenkins {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
server_name {{ jenkins_url }};
rewrite ^ https://$server_name$request_uri? permanent;
}
You can’t perform that action at this time.