Skip to content

Instantly share code, notes, and snippets.

Error.prototype.stack

Chrome

Error
    at f (eval at <anonymous> (first-steps-bundle.js:33), <anonymous>:5:11)
    at g (eval at <anonymous> (first-steps-bundle.js:33), <anonymous>:8:5)
    at eval (eval at <anonymous> (first-steps-bundle.js:33), <anonymous>:10:3)
    at eval (eval at <anonymous> (first-steps-bundle.js:33), <anonymous>:16:2)
@dikiaap
dikiaap / git-io-custom-url.md
Last active June 19, 2024 01:26
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
if (typeof window!=='undefined' && navigator.serviceWorker && navigator.serviceWorker.controller) {
let reloadOnNext = false;
let pushState = history.pushState;
history.pushState = function(state, title, url) {
pushState.call(this, state, title, url);
if (reloadOnNext===true) location.reload(true);
};
navigator.serviceWorker.controller.addEventListener('statechange', e => {
dialog {
position: fixed;
top: 50%;
left: 50%;
right: auto;
padding: 30px;
transform: perspective(500px) translate(-50%, -50%);
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF;
border: none;
border-radius: 3px;
@Geoyi
Geoyi / install virtualenv ubuntu 16.04.md
Created September 16, 2017 12:19 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@developit
developit / *state-machine-component.md
Last active February 6, 2021 00:44
265b lib for building pure functional state machine components. https://github.com/developit/state-machine-component

state-machine-component

A tiny (265 byte) utility to create state machine components using two pure functions.

🔥 JSFiddle Demo

Usage

The API is a single function that accepts 2 pure functions as arguments:

@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

import express from 'express';
import React from 'react';
import ReactDOMServer from 'react-dom/server';
import App from './components/App';
import {flushServerSideRequires} from 'react-loadable';
let app = express();
let webpackStats = require('./output-webpack-stats.json');
@scurker
scurker / AsyncComponent.jsx
Created January 20, 2017 22:16
Async Component in Preact
import { h, Component } from 'preact';
class AsyncComponent extends Component {
constructor() {
super();
this.state = { loading: true };
this.getAsyncState = this.getAsyncState.bind(this);
this.update = this.update.bind(this);
}
@geoffreydhuyvetters
geoffreydhuyvetters / react_fiber.md
Last active August 15, 2024 15:17
What is React Fiber? And how can I try it out today?