Skip to content

Instantly share code, notes, and snippets.

View Hyllesen's full-sized avatar
🐱

Stefan Hyltoft Hyllesen

🐱
View GitHub Profile
@tolumide-ng
tolumide-ng / index.js
Created August 20, 2019 18:14
Testing Formik with Jest and Enzyme
import './index.css';
import React from 'react';
import { connect } from 'react-redux';
import { css } from '@emotion/core';
import SyncLoader from 'react-spinners/SyncLoader';
import { Formik, Form, Field } from 'formik';
import { authAction } from '../../store/modules/auth/actions';
import logo from '../../assets/images/logo.png';
import SignupSchema from './schema';
@joshnuss
joshnuss / app.js
Last active March 4, 2024 00:01
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@MatthewSteel
MatthewSteel / ttt.c
Created July 22, 2012 05:35
Minimax (full tree search) tic-tac-toe AI in C
//Tic-tac-toe playing AI. Exhaustive tree-search. WTFPL
//Matthew Steel 2009, www.www.repsilat.com
#include <stdio.h>
char gridChar(int i) {
switch(i) {
case -1:
return 'X';
case 0: