Skip to content

Instantly share code, notes, and snippets.

View lefant's full-sized avatar

Fabian Linzberger lefant

View GitHub Profile
@shuding
shuding / swr-suspense-journey.md
Created September 14, 2021 12:18
The Journey of SWR and Suspense

The Journey of SWR and Suspense

We are trying to combine the idea of SWR ("stale-while-revalidate") and React Suspense together, and this write-up covers all our findings from this journey.

Background

When React Hooks launched, people started to rely on useEffect to initiate data fetching:

function User () {
# Copyright 2019 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# This snippet shows you how to use Blob.generate_signed_url() from within compute engine / cloud functions
# as described here: https://cloud.google.com/functions/docs/writing/http#uploading_files_via_cloud_storage
# (without needing access to a private key)
# Note: as described in that page, you need to run your function with a service account
# with the permission roles/iam.serviceAccountTokenCreator
import os, google.auth
from google.auth.transport import requests
@dyerrington
dyerrington / subplots.py
Created March 29, 2017 21:33
Plotting multiple figures with seaborn and matplotlib using subplots.
##
# Create a figure space matrix consisting of 3 columns and 2 rows
#
# Here is a useful template to use for working with subplots.
#
##################################################################
fig, ax = plt.subplots(figsize=(10,5), ncols=3, nrows=2)
left = 0.125 # the left side of the subplots of the figure
right = 0.9 # the right side of the subplots of the figure
@itod
itod / split_keyboards.md
Last active June 12, 2024 12:08
Every "split" mechanical keyboard currently being sold that I know of
@haf
haf / gist:ed9adfbadade14ca86fa9683bfdc7d49
Created October 19, 2016 17:04
Shownotes redux/react
# What's redux?
- state + action -> reducer -> store -> connect (utils)(component) -> render
- reducers are scoped to action types
## redux's connect function
Responsible for mapping { state, dispatch } to props as first curried parameter. Second curried parameter is the component.
=> export default connect(mS, mD)(Comp);
import matplotlib.pyplot as plt
import numpy as np
import seaborn
from keras.layers import Input, Dense, merge, ELU, Dropout
from keras.models import Model
from keras.regularizers import l2
from keras import backend as K
from keras.optimizers import rmsprop, adam
@lefant
lefant / engineer.md
Last active December 12, 2015 10:27
Sellpy Software Engineer job ad

software engineer at Sellpy

We are looking for a generalist, talented & enthusiastic about joining an early phase startup, looking to have a big impact on the product, design & architecture of our system.

Sellpy is one of Sweden’s fastest growing startups and have already helped thousands of people to sell the things they don’t use anymore. We want to revolutionize the way we sell used goods and make

@dbp
dbp / circle.yml
Last active June 29, 2017 09:53
Haskell project with Stack on CircleCI
dependencies:
cache_directories:
- "~/.stack"
pre:
- wget https://github.com/commercialhaskell/stack/releases/download/v0.1.2.0/stack-0.1.2.0-x86_64-linux.gz -O /tmp/stack.gz
- gunzip /tmp/stack.gz && chmod +x /tmp/stack
- sudo mv /tmp/stack /usr/bin/stack
override:
- stack setup
- stack build
@tabacof
tabacof / lasso.py
Last active August 29, 2015 14:14
Lasso in PyMC3
from pymc import *
from scipy.stats import norm
import pylab as plt
# Same model as the tutorial
n = 1000
x1 = norm.rvs(0, 1, size=n)
x2 = -x1 + norm.rvs(0, 10**-3, size=n)
x3 = norm.rvs(0, 1, size=n)