Skip to content

Instantly share code, notes, and snippets.

View harriha's full-sized avatar

Harri Hälikkä harriha

  • Futurice
  • Helsinki, Finland
View GitHub Profile
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active July 22, 2024 18:20
Building a react native app in WSL2
@ykarikos
ykarikos / docker-ssl-proxy.md
Last active October 30, 2023 09:39
Self-signed SSL reverse proxy with Docker

Self-signed SSL reverse proxy with Docker

This is based on the marvellous blog posting by Oliver Zampieri.

This howto is written to create a self signed SSL NginX proxy on MacOS to

  1. Expose proxy at local host port 5001
  2. Connect the port 5001 to port 443 inside Docker
  3. Proxy the port 443 to port 5000 on the host computer

This means that:

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@milankorsos
milankorsos / redux-actions.ts
Last active November 10, 2022 10:58
Correct TypeScript typing example for Redux Thunk actions
import {Action, ActionCreator, Dispatch} from 'redux';
import {ThunkAction} from 'redux-thunk';
// Redux action
const reduxAction: ActionCreator<Action> = (text: string) => {
return {
type: SET_TEXT,
text
};
};
@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

@developit
developit / purecomponent.js
Created April 25, 2017 11:43
PureComponent for preact
import { Component } from 'preact';
export default class PureComponent extends Component {
shouldComponentUpdate(props, state) {
return !(shallowEqual(props, this.props) && shallowEqual(state, this.state));
}
}
function shallowEqual(a, b) {
for (let key in a) if (a[key]!==b[key]) return false;
@tkh44
tkh44 / Home.js
Last active September 13, 2022 01:32
Example of using branch to conditionally render components based on auth state
import authDoor from 'hoc/auth-door'
import Loadable from 'react-loadable';
import Loading from './Loading'
const Dashboard = Loadable({
loader: () => import('pages/Dashboard'),
LoadingComponent: Loading,
// optional options...
delay: 200,
serverSideRequirePath: path.join(__dirname, 'pages/Dashboard'),
@vsaarinen
vsaarinen / react-some-component.d.ts
Last active April 25, 2020 22:42
How to add TypeScript prop type definitions to an existing React component
import * as React from 'react';
declare class SomeReactComponent extends React.Component<SomeReactComponentProps, any> {}
interface SomeReactComponentProps {
className?: string;
toggle?: boolean;
name: string;
size?: 'lg' | '2x' | '3x' | '4x' | '5x';
}
@Rich-Harris
Rich-Harris / service-workers.md
Last active July 10, 2024 17:04
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.

@kimmobrunfeldt
kimmobrunfeldt / hapi-for-express-devs.md
Last active July 6, 2016 13:21
Hapi for Express developers