Skip to content

Instantly share code, notes, and snippets.

View jimlambie's full-sized avatar
🐙

James Lambie jimlambie

🐙
  • Dunedin, New Zealand
  • 19:30 (UTC +12:00)
View GitHub Profile
[
{
"name": "Aberdare Park"
},
{
"name": "Adelaide International Raceway"
},
{
"name": "Adelaide Parklands"
},
@jimlambie
jimlambie / tracking.js
Last active October 14, 2024 21:29
Tracking code template for CKH
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2EW05DQ9FB"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-2EW05DQ9FB');
</script>
<script>
@jimlambie
jimlambie / gist:6b05625c07bd1a1e52cd97dbc56c6a50
Created July 10, 2024 21:07
function to extract event data from CMS item
const PostUtils = require('./path/to/lib/post.js')
const prepareEventData = contentItem => {
try {
const postUtils = new PostUtils(contentItem)
const event = contentItem && {
...contentItem,
...postUtils.combinePostSections()
}
[
{
"title": "Scary Cars Assembly",
"date": "2024-06-04T01:09:37.439Z",
"orderId": "665e695109cb3900121484f5",
"orderNumber": "100027",
"tickets": [
{
"customerId": "65f0da3aac81240012b84bc8",
"customerEmail": "jim+my1shoe@27.works",
@jimlambie
jimlambie / Mapmyrun exporter.js
Created October 3, 2022 06:32 — forked from stampyzfanz/Mapmyrun exporter.js
Exports Mapmyrun workouts to a series of tcx files which can be imported into lots of software.
// # Javascript to copy in dev tools console
let data = await (await fetch("https://www.mapmyrun.com/internal/allWorkouts/?started_after=2020-01-29")).json()
// Change started_after for date you want to filter from or remove entirely for every workout
// Api parameters:
// number user= *id* - can be found in url of the person's profile ie https://www.mapmyrun.com/profile/[id]/activity_feed
// ISO-8601-date started_after= *date* for example this is valid 2020-01-29
// ISO-8601-date started_before= *date* this is another valid date 2011-10-05T14:48:00.000Z
// Remove ?user= to access only your own workouts
// Example url using all 3 parameters
// https://www.mapmyrun.com/internal/allWorkouts/?started_after=2020-01-29&started_before=2021-5-29&user=123456789
@jimlambie
jimlambie / celo
Created February 15, 2021 12:24
CELO development starter tutorial
CELO Testnet Address: 0xC0317003c3F7C88b50eF416D3C25C250EaA8948B

Local computer

  1. Make new directory and change into it
~ $ mkdir my-files
~ $ cd my-files
  1. Add a new file to the directory
BASE_PORT=3001
INCREMENT=1
port=$BASE_PORT
isfree=$(netstat -taln | grep $port)
while [[ -n "$isfree" ]]; do
port=$[port+INCREMENT]
isfree=$(netstat -taln | grep $port)
done

Keybase proof

I hereby claim:

  • I am jimlambie on github.
  • I am jimlambie (https://keybase.io/jimlambie) on keybase.
  • I have a public key ASA6aKbpU8CsoQdHOtOu6a6WFemxHrkhb3X-TWD2n6LwDwo

To claim this, I am signing this object:

@jimlambie
jimlambie / sale.md
Last active January 26, 2018 11:30

Public Sale Contract

Things to test

  • The USD/ETH rate in the contract is $1064.11/ETH
  • There is a USD5000 individual cap, so the maximum you could contribute is ~4.69 ETH
  • The maximum gas price is 60 Gwei. Transactions above this will be rejected.