Skip to content

Instantly share code, notes, and snippets.

import type { LoaderArgs } from "@remix-run/server-runtime";
import {
Outlet,
useFetcher,
useLoaderData,
useRevalidator,
} from "@remix-run/react";
import { useEffect, useState } from "react";
import { json } from "@remix-run/server-runtime";
import { supabaseServerClient } from "~/utils/server/supabase.server";
@AWaselnuk
AWaselnuk / notes_from_forwardjs_2016.md
Created August 20, 2016 03:49
Notes from ForwardJS conf. July 29, 2016

Notes from ForwardJS conf - July 29, 2016

ForwardJS conf was a JavaScript conference held at the Regency Ballroom in San Francisco. It was my first time attending a tech conference and my first time in San Francisco and it was magical! The format was a mix of panel discussions and presentations, as well as full day workshops throughout the week.

I attended the Asynchronous programming in JavaScript workshop put on by Kyle Simpson (@getify) and it was awesome. We basically learned how to control time. I left feeling like a Tralfamadorian.

I will be writing a bit more about why I took chose that course on my blog. Below are the rough notes from talks and panel discussions:

@AWaselnuk
AWaselnuk / stuck_on_decoders.elm
Created July 8, 2016 12:44
I don't understand custom event handlers and decoders in Elm
type alias Model =
{ level : Int
, name : String
}
type Msg
= ModifyLevel Int
| ModifyName String
levelOptionsView : Model -> Html Msg
@AWaselnuk
AWaselnuk / react_shopify_product_image.jsx
Last active January 11, 2016 15:21
A React Component to handle responsive product images from the Shopify API
import React from 'react';
const SIZES = {
'pico': 16,
'icon': 32,
'thumb': 50,
'small': 100,
'compact': 160,
'medium': 240,
'large': 480,
@AWaselnuk
AWaselnuk / nav_link_to.rb
Created November 20, 2015 19:59
Rails style link_to helper for active nav links.
@AWaselnuk
AWaselnuk / tweet_sized_templating.js
Created June 19, 2015 12:17
Tweet Sized Templating Engine
// From: http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/
function t (s,d) {
for (var p in d)
s=s.replace(new RegExp('{'+p+'}','g'), d[p]);
return s;
}
// Call it like this:
// t("Hello {who}!", { who: "JavaScript" });
@AWaselnuk
AWaselnuk / css_spinner.css
Created February 6, 2015 14:25
Single element CSS spinner
#spinner {
width: 150px;height: 150px;
-webkit-animation: sweep 1s infinite linear;
border-radius:75px;
border-bottom:5px solid #ccc;
}
@-webkit-keyframes sweep { to { -webkit-transform: rotate(360deg); } }
@AWaselnuk
AWaselnuk / regex_cheatsheet.js
Created February 5, 2015 18:15
Regex cheatsheet as JS comments
// From: http://regexone.com/
//
// abc… Letters
// 123… Digits
// \d any Digit
// . any Character
// \. Period
// [abc] Only a, b, or c
// [^abc] Not a, b, nor c
// [a-z] Characters a to z
@AWaselnuk
AWaselnuk / get_random_int.js
Created January 26, 2015 21:35
Get a random integer between min and max
// Returns a random integer between min (included) and max (excluded)
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
@AWaselnuk
AWaselnuk / raml_handlebars_html.coffee
Last active August 29, 2015 14:13
Converting a RAML file to a Handlebars template and then to an HTML file.
## parse a .raml file and then compile Handlebar templates
# Import libraries
fs = require('fs')
appRoot = require('app-root-path')
RAML = require('raml-parser')
Handlebars = require('handlebars')
saveTemplate = (pathToView, renderedTemplate) ->
console.log 'Saving template'