Skip to content

Instantly share code, notes, and snippets.

View kieran's full-sized avatar
📚
40 day free trial!

Kieran Huggins kieran

📚
40 day free trial!
View GitHub Profile
@kieran
kieran / index.scss
Created January 27, 2021 22:46
sass math test (npm run build)
@use "sass:math";
@debug math.$pi;
fragment UserCardFragment on User {
id
url
avatarUrl
email
}
# api - you have to run this locally
backend rails {
.host = "localhost";
.port = "3000";
}
# local version of ember app
backend ember_app {
.host = "localhost";
import React from 'react'
import debounce from 'underscore-es/debounce'
# fixes @reach/router scrolling issue
update_scroll_position = debounce ->
history.replaceState { history.state..., scrollY }, document.title
, 100
export default \
class Layout extends React.Component
@kieran
kieran / README.md
Last active August 30, 2019 19:16
checks package-lock.json for TJ authored components

usage

paste file in root of your npm project

npm i
node ./tj-check.js

For a colourized tree view of the dependencies:

#
# XLS helpers
#
def xls_header
<<~EOF
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
# frozen_string_literal: true
module ActiveSupport
# Abstract super class that provides a thread-isolated attributes singleton, which resets automatically
# before and after each request. This allows you to keep all the per-request attributes easily
# available to the whole system.
#
# The following full app-like example demonstrates how to use a Current class to
# facilitate easy access to the global, per-request attributes without passing them deeply
# around everywhere:

Keybase proof

I hereby claim:

  • I am kieran on github.
  • I am khug (https://keybase.io/khug) on keybase.
  • I have a public key ASDNBU8A-sJ7AgXfHe0dm7r46T17fbuc5F2Tty7zIKDT0go

To claim this, I am signing this object:

@kieran
kieran / part1.coffee
Created December 4, 2017 05:12
Advent of Code - day 3
###
Example square:
17 16 15 14 13
18 5 4 3 12
19 6 1 2 11
20 7 8 9 10
21 22 23---> ...
###
@kieran
kieran / container.coffee
Created November 26, 2016 21:07
react routes example (in routes/big_calendar)
{ connect } = require 'react-redux'
# provide state
mapStateToProps = (state)->
{ events, eventsLoading } = state
{ events, eventsLoading }
# provide actions
{ getEvents } = require 'actions/events'
mapDispatchToProps = (dispatch)->