Skip to content

Instantly share code, notes, and snippets.

View hansott's full-sized avatar
:shipit:
Shipping

Hans Ott hansott

:shipit:
Shipping
View GitHub Profile
@hansott
hansott / subl.sh
Last active September 1, 2015 17:01
Use sublime as "subl" in your terminal
echo 'export PATH="$HOME/bin:$PATH";' >> ~/.bash_profile
mdkir ~/bin
ln -s ~/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/bin/subl
@hansott
hansott / Makefile
Created March 21, 2016 08:40 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@hansott
hansott / keybase.md
Created August 1, 2016 08:05
keybase.md

Keybase proof

I hereby claim:

  • I am hansott on github.
  • I am hansott (https://keybase.io/hansott) on keybase.
  • I have a public key ASBaddsO2x5jvRIiL-ZL0phJiTgZq9kLLVljMuEG8Gq4Xwo

To claim this, I am signing this object:

@hansott
hansott / component.jsx
Last active April 12, 2019 14:20
redux-logger for useReducer
import { logger } from "./logger";
import React, { useReducer } from "react";
const reducer = (state, action) => state;
const initialState = {};
export const Component = () => {
const [state, dispatch] = useReducer(logger(reducer), initialState);
return <div></div>;
describe("ForgotPassword", () => {
test("it sends email when reset is requested", async () => {
const users = new UsersInMemory();
const forgotPassword = new ForgotPassword(users);
// ...
});
});
export function getUserByEmail(mysql: MySQL, email: string) {
return await mysql.select(
"SELECT id, email, ... FROM users WHERE email = :email",
{ email: email }
);
}