Skip to content

Instantly share code, notes, and snippets.

View benawad's full-sized avatar

Ben Awad benawad

View GitHub Profile
import * as Sentry from "@sentry/node";
import imagemin from "imagemin";
import mozjpeg from "imagemin-mozjpeg";
import sharp from "sharp";
import isJpg from "is-jpg";
import * as aws from "aws-sdk";
import { Upload } from "../../types/graphqlUtils";
import { generateFilename } from "./generateFilename";
export const s3 = new aws.S3({
" 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'
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
-- 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
);
function hashStringToInt(s, tableSize) {
let hash = 17;
for (let i = 0; i < s.length; i++) {
hash = (13 * hash * s.charCodeAt(i)) % tableSize;
}
return hash;
}
  • JavaScript vs. TypeScript
  • Coding Interviews are great
  • Deno vs. Node
  • flutter vs react-native
  • is HTML a programming language
  • JWT vs Sessions
  • Hooks are Bad (React)
  • light mode vs dark mode
  • React is bad
  • React vs Plain HTML/Vanilla Javascript
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
// I'm trying to get paths with clip-rule to work. Example:
// <path fill-rule="evenodd" clip-rule="evenodd" d="M148 62.5C148" />
// this works
const p = Skia.Path.MakeFromSVGString(`<path fill-rule="evenodd" clip-rule="evenodd" d="M148 62.5C148" />`)
const frame0 = {
props: {
"fillRule": "evenodd",
"clipRule": "evenodd",
function clickAccept() {
document.querySelectorAll('button.artdeco-button--secondary').forEach(b => {
if (b.innerText.includes('Accept')) {
b.click()
}
});
}
function loadMore() {
document.querySelector('button.artdeco-button--icon-right').click()
{
// Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Typescript React PureComponent": {
"prefix": "rpc",
"body": [
"import * as React from 'react'",