Skip to content

Instantly share code, notes, and snippets.

<form
name="waitlist"
data-netlify="true"
netlify-honeypot="bot-field"
className="bg-primary p-10 mt-4 rounded shadow-md"
onSubmit={(e) => {
fetch("/", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: encode({ "form-name": "waitlist", email }),
/**
 * Frontend Mock Interview
 * 1. Web APIs and technologies
 * 2. Coding questions
 * 3. Web application frameworks questions
 */

/**
 * 1. Web APIs and technologies
@dariye
dariye / RightClick.applescript
Created March 31, 2020 06:35 — forked from vitorgalvao/Right Click.applescript
Make right-clicking on OSX accessible via a keyboard shortcut.
(*
Even though a [native solution][1] exists, it still suffers from a big flaw: it right-clicks the place you cursor is, not what you’re selecting. This addresses that limitation.
You can install this as a [Finder Service, and later asign it a keyboard shortcut][2].
[1]: http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os
[2]: http://www.macosxautomation.com/services/learn/tut01/index.html
*)
@dariye
dariye / theme.ts
Created June 26, 2019 08:49
theme.ts
import { darken, parseToHsl, hsl, getLuminance } from "polished";
const addAliases = (arr: (string | number)[], aliases: string[]) =>
aliases.forEach((key, i) =>
Object.defineProperty(arr, key, {
enumerable: false,
get() {
return this[i];
}
})
);

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@dariye
dariye / tmux-cheatsheet.markdown
Created March 7, 2019 13:57 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dariye
dariye / index.css
Created November 6, 2018 17:48
WorrisomeSaddlebrownRuby created by pauldariye - https://repl.it/@pauldariye/WorrisomeSaddlebrownRuby
Empty file
@dariye
dariye / micro-db-server.js
Created September 9, 2018 13:39
Micro-starter
const { json, send } = require('micro')
module.exports = async (req, res) => {
return send(res, 200, req.url)
}
@dariye
dariye / micro-proxy.js
Created September 7, 2018 15:02
micro-proxy.js programmatic usage
const createProxy = require('micro-proxy')
const services = require('./services')
const {port} = require('./config').server
const server = createProxy(Object.values(services)
.map(service => service[process.env.NODE_ENV]))
server.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
@dariye
dariye / github.js
Last active August 21, 2018 01:13
GitHub api clients and utility methods
const async = require('async')
const Github = require('github-api')
const { GraphQLClient } = require('graphql-request')
const { query, mutation } = require('../graphql')
const config = require('../config')
const { token, repo, owner } = config.github
const issues = new Github({ token }).getIssues(`${owner}/${repo}`)
const graphqlClient = new GraphQLClient('https://api.github.com/graphql', {
headers: { Authorization: `bearer ${token}`, }