Skip to content

Instantly share code, notes, and snippets.

View silentworks's full-sized avatar

Andrew Smith silentworks

View GitHub Profile
@silentworks
silentworks / client_code.js
Created November 9, 2021 10:10
Creating a Table with RLS enabled and a View with only the data you want exposed
// Get poll data and slug for voting path but no results slug
const { data, error } = await supabase.from('poll_without_results')
.select('*')
<script>
import { onMount } from 'svelte'
let borat
const imgLoaded = (img) => img.complete && img.naturalHeight !== 0
onMount(() => {
console.info(imgLoaded(borat))
})
</script>
@silentworks
silentworks / Notes.md
Created January 13, 2020 21:40 — forked from tlakomy/Notes.md
Notes from Build an App with React Suspense, Hooks, and Context Workshop Setup with Michael Chan

Egghead Workshop Notes

Notes from Build an App with React Suspense, Hooks, and Context Workshop Setup with Michael Chan

  • Write a detailed README with contact info, info about the workshop itself, license etc
  • Create a folder for each lesson so folks won’t have to struggle with switching git branches every 15 minutes
  • Give everyone a minute to process what they’ve learned and to figure out whether they have questions
  • Reference the docs so once the workshop concludes everyone knows where to find the resources to refresh what they’ve learned
  • As with egghead lessons, guide their eyes - if you’re explaining something, then select it in your IDE (at least hover over it)
  • Take a minute to go over the questions from the chat, read the question out loud
  • Don’t be afraid to experiment when there’s an interesting question, we’re all nerds here who love to try out new stuff
@silentworks
silentworks / php-pdo-mysql-crud.md
Created January 8, 2019 11:33 — forked from taniarascia/php-pdo-mysql-crud.md
Basic CRUD operations with PDO and MySQL

Basic CRUD operations with PDO

CRUD = Create, Read, Update, Delete

Open a database connection

$host = '127.0.0.1';
$dbname = 'test';
$username = 'root';
<div class="question-set">
{#if question}
<Question
on:answer="{({ detail }) => checkAnswer(detail.option)}"
on:next="{({ detail }) => onToNext(detail.question)}"
question="{question}"
totalTries="3"
/>
{:else}
<Feedback questions="{questions}" totalPoints="3" />
@silentworks
silentworks / README.md
Created November 14, 2018 11:13 — forked from zulhfreelancer/README.md
How to install Flynn on single host (single-node mode)?

$ sudo bash -c "$(curl -s https://gist.githubusercontent.com/zulhfreelancer/0b87a274686cb4d98b8144e116c5117c/raw)"

@silentworks
silentworks / setup.sh
Created November 14, 2018 11:13 — forked from eduwass/setup.sh
Flynn Install : Single node ( for Ubuntu 14.04 x64 @ DigitalOcean droplet )
#!/bin/bash
# This script will automatically set up a single node Flynn Cluster on your linux box
# Fresh Flynn install with domain provided by the xip.io service
# Tested with Base Image: Ubuntu 14.04 x64 @ DigitalOcean droplet
# @date 16 Nov 2015
# @author Edu Wass (eduwass at gmail com)
echo '---- START SETUP ----'
@silentworks
silentworks / stop-mac-apache.sh
Created June 2, 2018 12:23 — forked from barbietunnie/stop-mac-apache.sh
Stop Default Apache server running on Mac OS Sierra
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
@silentworks
silentworks / server.js
Created May 28, 2018 08:08 — forked from rob-balfre/server.js
Example of Sapper using Passport
import express from 'express';
import passport from 'passport';
import {Strategy} from 'passport-github';
import compression from 'compression';
import sapper from 'sapper';
import serve from 'serve-static';
import {routes} from './manifest/server.js';
import App from './App.html';
import _ from '../SECRETS';
@silentworks
silentworks / app.js
Created May 15, 2018 09:32 — forked from joshuataylor/app.js
Preact component to notify user when a change has been made, and on route change reload the page.
import { h, Component } from 'preact';
import { Router } from 'preact-router';
import Header from './header';
import Home from '../routes/home';
import Profile from '../routes/profile';
import NotifyChange from "./NotifyChange/index";
// import Home from 'async!../routes/home';
// import Profile from 'async!../routes/profile';