Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Awad benawad

View GitHub Profile
View apollo-helper-function.js
import { produce } from "immer";
import { ApolloCache } from "@apollo/client";
export const updateQuery = (
store,
query,
fn,
variables
) => {
let data;
View frontend-github-action-example.yml
steps:
- uses: actions/checkout@v2
- run: yarn install
- run: yarn test
- run: yarn build
# make sure to add netlify-cli in your package.json
- name: Send to Netlify
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
View backend-github-action-example.yml
steps:
- uses: actions/checkout@v2
- run: yarn install
- run: yarn test
- run: yarn docker:build
- run: yarn docker:login
View dev-debate-topics.md
  • 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
View dev-debate.md

Dev Debate - debating viewers on tech topics

rules

  1. We agree on a topic
  2. I debate someone for a max of 30 minutes
  3. At the end of Twitch chat votes who won

possible topics - suggestions welcome

View fun-code-stream.txt
1. pair programming
3. coding an interesting project (doesn't work), but demoing one will
5. clash of coding or some kind go coding game
6. try to teach __any_famous_twitch_streamer__ to code (problem is getting one of them interested)
7. collab with coding train + coding garden
Top tier coding streams ATM
+2,000
- Michael Reeves
View auto-accept-linkedin-conns.js
[...document.querySelectorAll('button.invitation-card__action-btn')].slice(0, 70).forEach(b => {
if (b.innerText === 'Accept') {
b.click()
}
})
@benawad
benawad / web-deploy.yml
Created Mar 28, 2020
Github Action for deploying https://www.mysaffronapp.com/ website
View web-deploy.yml
name: web-deploy
on:
push:
tags:
- "web-*"
- "both-*"
jobs:
landing:
@benawad
benawad / [slug].js
Created Mar 24, 2020
ssg + mdx next.js
View [slug].js
import fs from "fs";
import MDX from "@mdx-js/runtime";
import ReactDOM from "react-dom/server";
import path from "path";
const Post = ({ post }) => {
return <div dangerouslySetInnerHTML={{ __html: post }} />;
};
export async function getStaticPaths() {
View beginner-tutorial.sql
-- 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
);
You can’t perform that action at this time.