Skip to content

Instantly share code, notes, and snippets.

@bengrunfeld
bengrunfeld / .bashrc
Created April 1, 2019 23:55
My .bashrc - just in case my computer dies
export PS1='\W $ '
export PATH=$PATH:/Users/ben/.ssh
# Unix shortcuts
alias ..='cd ..'
# Shortcuts to directories and commands
alias c='cd ~/Desktop/Work/code'
alias p='c; cd passli-cli'
@bengrunfeld
bengrunfeld / API_GUIDELINES.md
Last active May 2, 2019 05:34
API Guidelines

REST API Guidelines

This is the set of guidelines that I use to build my API's. Borrows heavily from Google's API Design Guide and Github's REST Api Docs.

Endpoints

  • List endpoints with HTTP Verb, expected input, and reponse message and data types

Client Errors

[...Array(5).keys()];

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Pivotal Ticket Number: #NUMBER

Type of change

Please delete options that are not relevant.

<!DOCTYPE html>
<html lang="en-AU" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Applying for Permanent Residency while on a Student Visa - 485 Visa Insurance</title>
<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="Applying for Permanent Residency while on a Student Visa - 485 Visa Insurance">
@bengrunfeld
bengrunfeld / 2013-statistics.html
Last active January 19, 2020 23:11
Gili sample page
# https://www.485visainsurance.com.au/2013-statistics
<h1 class="entry-title">2013 Stats For 485 Visa Applications</h1>
<p class="byline author vcard"><time class="updated" datetime="2013-12-30T03:48:26+00:00">December 30, 2013</time> By <a href="./../author/gili/index.html" rel="author" class="fn">Gili Shiffman</a></p>
</header>
<div class="entry-content">
<p>The newest statistics released by the Australian government shows a huge growth in the use of 485 visa&#8217;s by overseas students who complete there studies in Australia.</p>
<p>While 20.7% of students chose to renew their student visa as they wanted to do further studies in Australia, or the remaining 79,3% approx 30% move to a temporary <strong>graduate subclass 485 visa</strong>.</p>
<p><img class="aligncenter size-full wp-image-2843" alt="Temporary Subclass 485 Visa Graduation" src="https://www.485visainsurance.com.au/wp-content/uploads/2013/12/Temporary-Subclass-485-Visa-Graduation.jpg" width="599" height="249" /></p>
@bengrunfeld
bengrunfeld / focus.jsx
Last active February 6, 2020 18:29
React Focus on Element on Load
import { useEffect, useRef, useState } from "react";
const focus = (ref: Reference<HTMLInputElement | null>) => {
if (ref && ref.current) {
ref.current.focus();
}
};
// Step 1. Create a ref that can be used for focus
const inputEl = useRef<HTMLInputElement | null>(null);
@bengrunfeld
bengrunfeld / Optics.md
Created February 20, 2020 11:04
Measly docs re Optics

Measly Docs for Optics

  • Fold

    • compose
    • concat
    • liftA3
    • pre
  • Lens

@bengrunfeld
bengrunfeld / index.jsx
Created June 21, 2020 08:17
GraphQL-Apollo-NextJS Starter App - pages/index.jsx
import { ApolloProvider } from "@apollo/react-hooks";
import ApolloClient, { gql } from "apollo-boost";
import { BookInfo } from "../components/BookInfo";
const Home = ({ data }) => {
const client = new ApolloClient({
uri: "http://localhost:3000/api/graphql-data",
});
return (
@bengrunfeld
bengrunfeld / BookInfo.jsx
Created June 21, 2020 08:20
GraphQL-Apollo-NextJS Starter App - components/BookInfo/BookInfo.jsx
import { useQuery, useMutation } from "@apollo/react-hooks";
import { gql } from "apollo-boost";
const GET_BOOK_DETAILS = gql`
query {
book {
name
author
}
}