Skip to content

Instantly share code, notes, and snippets.

View bobjflong's full-sized avatar

Bob Long bobjflong

View GitHub Profile
function Get-ExcitedStates {
& "$env:USERPROFILE\Desktop\Extract-ExcitedStates.ps1" -Path $args[0]
}
Set-Alias excited Get-ExcitedStates
param(
[Parameter(Mandatory=$true)]
[string]$Path
)
Select-String -Path $Path -Pattern '^\s*Excited\s+State\s+\d+:' | ForEach-Object { $_.Line }
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: “bob@intercom.io”,
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}