Skip to content

Instantly share code, notes, and snippets.

View iam4x's full-sized avatar
🐧

iam4x iam4x

🐧
View GitHub Profile
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@mweststrate
mweststrate / mobx.js
Created June 15, 2016 19:20
Local component state with MobX
import {observable} from "mobx"
import {observer} from "mobx-react"
@observer class Select extends React.Component {
@observable selection = null; /* MobX managed instance state */
constructor(props, context) {
super(props, context)
this.selection = props.values[0]
}
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2024 16:24
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@dtran320
dtran320 / circle.yml
Last active October 13, 2016 00:15
Yarn on CircleCI
dependencies:
pre:
- curl -o- -L https://yarnpkg.com/install.sh | bash
override:
- yarn
post: # At least for me, it doesn't seem like `scripts` in `package.json` are being run, so you need to add them explicitly
- yarn run postinstall
@threepointone
threepointone / glam-for-css-folks.md
Last active September 4, 2022 07:43
why css purists will love glam

I made a little styling lib called glam

(some features are in development)

one

let's start off with the simplest use case. we'll make an 'index.html' page, and assume we've setup our js bundler to output bundle.js

@GiamPy5
GiamPy5 / selectHierarchicalMenu.js
Last active March 17, 2021 13:55
Hierarchical Tree Menu with Select Box (instantsearch)
var customMenuRenderFn = function (renderParams, isFirstRendering) {
var container = renderParams.widgetParams.container;
var title = renderParams.widgetParams.title;
var templates = renderParams.widgetParams.templates;
var cssClasses = renderParams.widgetParams.cssClasses || "";
var attributes = renderParams.widgetParams.attributes.map(function (attribute) {
return attribute.replace('.', '___');
});
var currentSelectedValue = null;
@trevorgreenleaf
trevorgreenleaf / px-rem-tw.csv
Last active April 1, 2024 15:42
PX to REM'S to TAILWIND CSS
PX REM TW
4 0.25 1
8 0.5 2
16 1 4
32 2 8
48 3 12
64 4 16
80 5 20
96 6 24
112 7 28
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
@yorickdowne
yorickdowne / GethBEHAVE.md
Last active March 13, 2024 01:10
Pruning Geth 1.10.x, 1.11.x, 1.12.x

Note: PBSS in Geth >=1.13.0 removes the need to prune manually.


Old content for reference

Overview

Geth (Go-Ethereum) as of July 2022 takes about 650 GiB of space on a fast/snap sync, and then grows by ~ 14 GiB/week with default cache, ~ 8 GiB/week with more cache.