Skip to content

Instantly share code, notes, and snippets.

View benawad's full-sized avatar

Ben Awad benawad

View GitHub Profile
-- code for https://youtu.be/tp_5c6jaNQE
create table users (
id serial primary key,
first_name varchar(255) not null,
last_name text,
age int,
email text unique not null
);
{
"cookbookLookup": [
{
"sectionId": "f04a8c56-e717-321c-8d8e-bacfe456cd10",
"cookbookId": "8a73c530-e1ec-3287-8e96-ad3a35367d39",
"sectionName": "Desserts",
"cookbookName": "Test Recipes"
}
],
"id": "bd9a25f2-051d-4033-b868-d9b7ac9f9abc",
function hashStringToInt(s, tableSize) {
let hash = 17;
for (let i = 0; i < s.length; i++) {
hash = (13 * hash * s.charCodeAt(i)) % tableSize;
}
return hash;
}
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
import React from "react";
import TodoForm from "./TodoForm";
import Todo from "./Todo";
/*
TodoMVC
1. add todo
2. display todos
3. cross off todo
4. show number of active todos
{
"rogue": {
"daggers": {
"crit": 20.0,
"hit": 17.0,
"mainHandDps": 14.0,
"offHandDps": 7.0,
"mainHandAvgDmg": 6.8,
"offHandAvgDmg": 0.0,
"agility": 1.7,
import { useState } from "react";
export const useForm = <T>(initialValues: T) => {
const [values, setValues] = useState(initialValues);
return [
values,
(e: any) => {
setValues({
...values,
export const useForm = initialValues => {
const [values, setValues] = useState(initialValues);
return [
values,
e => {
setValues({
...values,
[e.target.name]: e.target.value
});