I hereby claim:
- I am si on github.
- I am si (https://keybase.io/si) on keybase.
- I have a public key whose fingerprint is 3DD0 CC9E 9013 B4B9 F3AB EA80 BE1F 8A74 AE1D 4280
To claim this, I am signing this object:
| <ul> | |
| <li> | |
| <a href="/week-1">Reports - 18 Mar</a> | |
| <ul> | |
| <li> | |
| <a href="/week-1/report-1">Report 1 - 18 Mar</a> | |
| </li> | |
| <li> | |
| <a href="/week-1/parent">Group of reports</a> | |
| <ul> |
| Verifying that "sijobling.id" is my Blockstack ID. https://explorer.blockstack.org/name/sijobling.id |
I hereby claim:
To claim this, I am signing this object:
| <h1>I (Heart) Sass!</h1> | |
| <p> | |
| We’re just getting to know Sass - say | |
| <q>“hello”</q>. | |
| </p> | |
| <a href="#" class="primary">HELLO</a> | |
| <a href="#" class="secondary">Goodbye</a> |
| Verifying myself: My Bitcoin username is +sijobling. https://onename.io/sijobling |
Adapted from: http://jimmybonney.com/articles/column_header_rotation_css/
A Pen by Si Jobling on CodePen.
| // This is the naming convention for date fields | |
| var field_name = "data[model][0][dob][day]"; | |
| // Existing regular expression for finding elements. | |
| var reg_fields = /^data\[([a-zA-Z]+)\]\[(\d+)\]\[([a-zA-Z]+)\]\[([a-zA-Z]+)\]?$/ ; | |
| // Match on date fields works ok (not sure why the first index is the full string). | |
| field_elements = field_name.match(reg_fields); | |
| // returns [ "data[model][0][dob][day]" , "model" ,"0", "dob", "day" ] | |
| SELECT first_name, last_name, dob, DATEDIFF(next_birthday, NOW()) AS distance | |
| FROM ( | |
| SELECT *, ADDDATE(birthday, INTERVAL birthday < DATE(NOW()) YEAR) AS next_birthday | |
| FROM ( | |
| SELECT *, ADDDATE(dob, INTERVAL YEAR(NOW()) - YEAR(dob) YEAR) AS birthday | |
| FROM users | |
| WHERE active = 1 AND dob IS NOT NULL | |
| ) AS T1 | |
| ) AS T2 | |
| ORDER BY distance ASC |
| I have a table of petrol purchases, each recording the current odometer reading: | |
| id | odometer | user_id | created | |
| ------------------------------- | |
| 2 | 63446 | 1 | 2012-01-15 11:27:57 | |
| 4 | 63835 | 1 | 2012-01-19 17:09:37 | |
| 5 | 64145 | 1 | 2012-01-28 13:02:08 | |
| I want to return each row along with a distance and days lasted for each record (comparing the current record with the next record). |