Skip to content

Instantly share code, notes, and snippets.

View blissdev's full-sized avatar

Jordan Arentsen blissdev

View GitHub Profile
@krisselden
krisselden / README.md
Last active July 28, 2021 15:44
Trace Chrome Deopts

trace-deopt.sh

How to use

./trace-deopt.sh http://localhost:4200

Wait until your page renders.

@boj
boj / config
Last active February 15, 2023 18:02
VMWare NixOS
// .config/termite/config
[options]
font = Liberation Mono 10
[colors]
foreground = #FFFFFF
background = #000000
if (
process.env.NODE_ENV === 'production' &&
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ &&
Object.keys(window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers).length
) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers = {}
}
@rafgraph
rafgraph / webpack.config.babel.js
Last active May 29, 2018 05:42
React production build with webpack
import webpack from 'webpack';
export default {
context: __dirname,
entry: './index.js',
output: {
path: `${__dirname}/__build__`,
filename: 'bundle.js',
},
module: {
@brandonpittman
brandonpittman / dracula.fish
Created June 2, 2016 11:51
Dracula colors for fish shell
set -x COMMENT 6272a4
set -x CYAN 8be9fd
set -x GREEN 50fa7b
set -x ORANGE ffb86c
set -x PINK ff79c6
set -x PURPLE bd93f9
set -x RED ff5555
set -x YELLOW f1fa8c
set -U fish_color_autosuggestion $COMMENT
const t = require("tcomb");
// imstruct is a tcomb type builder that internally builds an
// Immutable.Record object, but applies tcomb's type system to it
const imstruct = require("../util/imstruct");
const Person = imstruct({
name: t.String,
age: t.Number
});
@iammerrick
iammerrick / children-as-function.js
Created May 24, 2016 23:41
Which API do you prefer? Passing a function into the Ratio component or making a higher order component called Ratio you can use to configure a component.
<Ratio width={Ratio.OPTIONS.FLUID} x={3} y={4}>
{(width, height) => (
<Chart id={this.props.id} width={width} height={height} />
)}
</Ratio>

Private members in ES6 classes

"Let's create an ES6 class!" you say. "Let's give it a private variable x."

class Foo {
  constructor(x) {
    this.x = x;
  }
  getX() {
@gaearon
gaearon / index.js
Last active January 21, 2025 08:07
Breaking out of Redux paradigm to isolate apps
import React, { Component } from 'react'
import Subapp from './subapp/Root'
class BigApp extends Component {
render() {
return (
<div>
<Subapp />
<Subapp />
<Subapp />
<!DOCTYPE html>
<html>
<head>
<title>Redux rocket launcher example</title>
<script src="https://npmcdn.com/redux@latest/dist/redux.min.js"></script>
<script src="https://npmcdn.com/[email protected]/dist/redux-saga.js"></script>
</head>
<body>
<p>
Example created to compare Redux + redux-saga implementation with