Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧

iam4x iam4x

🐧
View GitHub Profile
@yorickdowne
yorickdowne / GethBEHAVE.md
Last active Sep 19, 2022
Pruning Geth 1.10.x
View GethBEHAVE.md

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.

This will fill a 1TB SSD in a few months, to the point where space usage should be brought down again with an offline prune.

There is an odd behavior with Geth 1.10.20 where initial DB size is large after sync until Geth has been restarted twice. This is expected to be fixed soon, possibly as soon as 1.10.21.

Happily, Geth 1.10.x introduces "snapshot offline prune", which brings it back down to about its original size. It takes roughly 4-6 hours to prune the Geth database, and this has to be done while Geth is not running.

Caveat that while several folx have used offline pruning successfully, there is risk associated with it. The two failure mode

View macOS-fixes.md

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
@trevorgreenleaf
trevorgreenleaf / px-rem-tw.csv
Last active Jul 11, 2022
PX to REM'S to TAILWIND CSS
View px-rem-tw.csv
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
@GiampaoloFalqui
GiampaoloFalqui / selectHierarchicalMenu.js
Last active Mar 17, 2021
Hierarchical Tree Menu with Select Box (instantsearch)
View selectHierarchicalMenu.js
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;
@threepointone
threepointone / glam-for-css-folks.md
Last active Sep 4, 2022
why css purists will love glam
View glam-for-css-folks.md

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

@dtran320
dtran320 / circle.yml
Last active Oct 13, 2016
Yarn on CircleCI
View circle.yml
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
@Rich-Harris
Rich-Harris / service-workers.md
Last active Sep 12, 2022
Stuff I wish I'd known sooner about service workers
View service-workers.md

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.

@mweststrate
mweststrate / mobx.js
Created Jun 15, 2016
Local component state with MobX
View mobx.js
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]
}
@rauchg
rauchg / README.md
Last active Sep 1, 2022
require-from-twitter
View README.md