Skip to content

Instantly share code, notes, and snippets.

View ferdinandsalis's full-sized avatar
🎯
Focusing

Ferdinand Salis ferdinandsalis

🎯
Focusing
View GitHub Profile
<!--
Put this file in ~/Library/LaunchAgents/com.example.KeyRemapping.plist to
automatically remap your keys when macOS starts.
See https://developer.apple.com/library/archive/technotes/tn2450/_index.html for
the key "usage IDs". Take the usage ID and add 0x700000000 to it before putting it
into a source or destination (HIDKeyboardModifierMappingSrc and
HIDKeyboardModifierMappingDst respectively).
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@brianleroux
brianleroux / main.sh
Created August 11, 2019 20:33
arc6 quickstart
# setup a workspace
mkdir testarc6
cd testarc6
npm init -f
npm i @architect/architect@6.0.0-RC.1
# generate a hello world function
npx arc init
# modify .arc file @aws with a bucket property for deploying
@timchambers
timchambers / fastmail-zone.js
Last active October 11, 2022 23:33
Generate a DNS zone file with the necessary zones for email hosting with fastmail
// A script to generate a zone file with all the email-related zones required by Fastmail
// Reference: https://www.fastmail.com/help/receive/domains-advanced.html#dnslist
//
// Run this script with node and copy the output to your clipboard
// $ node fastmail-zone yourdomain.com | pbcopy
//
// Paste into AWS Route53 "Import zone file" field when creating a new zone, etc.
const render = (DOMAIN) => {
console.log(`;; Fastmail-hosted zones (email only)
@threepointone
threepointone / 0 basics.md
Last active March 21, 2023 01:53
css-in-js

A series of posts on css-in-js

0. styles as objects

First, an exercise. Can we represent all of css with plain data? Let's try.

let redText = { color: 'red' };
@nikgraf
nikgraf / .eslintrc.js
Last active July 12, 2019 19:11
Prettier / Eslint Setup
module.exports = {
root: true, // make to not take in any user specified rules in parent folders
parser: 'babel-eslint',
extends: ['airbnb', 'prettier', 'prettier/flowtype', 'prettier/react'],
env: {
browser: true,
node: true,
jest: true,
},
plugins: ['flowtype'],
@busypeoples
busypeoples / FlowTutorial.js
Last active July 17, 2023 10:12
Flow Fundamentals For JavaScript Developers
//
// MIT License
//
// Copyright (c) 2018 Ali Sharif
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// how I share state anywhere in the tree
<Route render={({ match: { params } }) => ()}/>
<Geolocation>
{coords => ()}
</Geolocation>
<FirebaseRef path="/somewhere">
{(doc) => ()}
</FirebaseRef>
@threepointone
threepointone / infinite.js
Created December 20, 2016 08:44
infinite scrolling pattern with react fiber (featuring intersection observers)
// inifinite scrolling of content without extra wrappers
const { render, findDOMNode } = ReactDOMFiber
class App extends React.Component {
render() {
// wrap the root element with an Intersection Observer, exposing .observe for children
return <Intersection>
<div style={{ height: 200, overflow: 'auto' }}>
<Page offset={0} count={10} />
</div>
@iammerrick
iammerrick / LazilyLoad.js
Last active August 7, 2019 14:15
Lazily Load Code Declaratively in React + Webpack
import React from 'react';
const toPromise = (load) => (new Promise((resolve) => (
load(resolve)
)));
class LazilyLoad extends React.Component {
constructor() {
super(...arguments);
import { Component } from 'react'
import { createStore, combineReducers } from 'redux'
import parseLinkHeader from 'parse-link-header'
const START = 'start'
const SUCCEED = 'succeed'
const ERROR = 'error'
const inflight = (state={}, action) => (
((state) => (