Skip to content

Instantly share code, notes, and snippets.

View bobjflong's full-sized avatar

Bob Long bobjflong

View GitHub Profile
alert(1);
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 2 columns, instead of 1 in line 1.
Before,After
```
window.intercomSettings = {
email: “[email protected]”,
favorite_color: “blue”,
pricing_plan: “gold”
};
```,
```
window.intercomEncryptedPayload = ‘
<html>
<body>
<script>alert(1);</script>
</body>
</html>
alert(1);
@bobjflong
bobjflong / evil.svg
Created December 2, 2016 13:57
example bad svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bobjflong
bobjflong / adt4.ex
Created November 5, 2016 19:47
adt4
value = %MyModule.Bar{}
result = MyModule.case value, [
Foo: fn(x) -> x + 1 end
]
# This fails at build time with:
# case macro not exhaustive.\nGiven [\"Foo\"].\nPossible: [\"Bar\", \"Foo\"].
@bobjflong
bobjflong / adt3.ex
Created November 5, 2016 19:46
adt3
value = %MyModule.Bar{}
result = MyModule.case value, [
Foo: fn(x) -> x + 1 end,
Bar: fn(x) -> x.val <> " there" end
]
# assert result == "hey there"
@bobjflong
bobjflong / adt2.ex
Created November 5, 2016 19:45
adt2
%MyModule.Foo{a: 1}
@bobjflong
bobjflong / adt.ex
Created November 5, 2016 19:43
adt1
defmodule MyModule do
ADT.define foo(a: 0) | bar(val: "hey")
end
> m1 = Mail.new("To: [email protected]\r\nSubject: Yo!\r\n\r\nHello there")
> m2 = Mail.new("To: [email protected]\r\nMessage-ID: <[email protected]>\r\nSubject: Yo!\r\n\r\nHello there")
> message_id = m2.header[:message_id].value
"<[email protected]>"
> m1 == m2
true
> message_id == m2.header[:message_id].value
false