I hereby claim:
- I am Linell on github.
- I am linell (https://keybase.io/linell) on keybase.
- I have a public key whose fingerprint is E285 1A23 F740 2AAF 6EE5 73C4 ACB8 24FC 7396 12F9
To claim this, I am signing this object:
| $(document).ready(function() { | |
| p = location.pathname.replace('/', '').split('/')[0]; | |
| $("#navbar a").each(function() { | |
| if ( $(this).attr('href').replace('/', '') == p ) { | |
| $(this).parent().addClass('active'); | |
| return; | |
| } | |
| }); | |
| }); |
| /* | |
| ▄███████▄ ▄█ █▄ ▄██████▄ ▄████████ ███▄▄▄▄ ▄█ ▀████ ▐████▀ | |
| ███ ███ ███ ███ ███ ███ ███ ███ ███▀▀▀██▄ ███ ███▌ ████▀ | |
| ███ ███ ███ ███ ███ ███ ███ █▀ ███ ███ ███▌ ███ ▐███ | |
| ███ ███ ▄███▄▄▄▄███▄▄ ███ ███ ▄███▄▄▄ ███ ███ ███▌ ▀███▄███▀ | |
| ▀█████████▀ ▀▀███▀▀▀▀███▀ ███ ███ ▀▀███▀▀▀ ███ ███ ███▌ ████▀██▄ | |
| ███ ███ ███ ███ ███ ███ █▄ ███ ███ ███ ▐███ ▀███ | |
| ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄███ ███▄ | |
| ▄████▀ ███ █▀ ▀██████▀ ██████████ ▀█ █▀ █▀ ████ ███▄ |
I hereby claim:
To claim this, I am signing this object:
| func isGood(number: Int) -> Bool { | |
| return (number % 3 == 0 || number % 5 == 0) | |
| } | |
| Array(3...999) | |
| .filter { (number) in isGood(number) } | |
| .reduce(0) { (total, number) in total + number } |
| def random_date | |
| date1 = DateTime.new(2014,8,1) | |
| date2 = DateTime.now() | |
| Time.at( (date2.to_f - date1.to_f)*rand + date1.to_f).to_date | |
| end |
| # Type(<scope>): <subject> | |
| # <body> | |
| # <footer> | |
| # Type should be one of the following: | |
| # * feat (new feature) | |
| # * fix (bug fix) | |
| # * docs (changes to documentation) |
| # The fancy anonymous function syntax. I'm kind of not a fan of it in this case. | |
| divisible? = &(rem(&1, 5) == 0 || rem(&1, 3) == 0) | |
| 1..999 |> Enum.filter(divisible?) |> Enum.sum |
| "Jose" | |
| |> String.codepoints() | |
| |> Enum.chunk(2) | |
| |> Enum.map(&Enum.join(&1, "")) | |
| # ["Jo", "se"] |
| Enum.filter(1..999, fn(x) -> rem(x, 5) == 0 || rem(x, 3) == 0 end) | |
| |> Enum.reduce(fn(x, acc) -> acc + x end) | |
| # 233168 |
| -- Works perfectly! | |
| SELECT COUNT(*), | |
| ST_Union(geom) as location_union, | |
| ST_SnapToGrid(ST_Transform(ST_SnapToGrid(ST_Transform(geom, _ST_BestSRID(geom)), 10,10),4326),0.0001, 0.0001) AS snap_pt | |
| FROM locations | |
| GROUP BY snap_pt | |
| HAVING COUNT(*) > 1; | |
| -- But what's a decent way to figure out which groups contain a given user? | |
| -- I can use the following query to get the list of users in an example ST_Union from above: |