Skip to content

Instantly share code, notes, and snippets.

View zvakanaka's full-sized avatar

Adam Quinton zvakanaka

View GitHub Profile
@chengsokdara
chengsokdara / useStore.js
Last active June 20, 2024 10:09
React global state in 15 lines of code.
// Author: Sokdara Cheng
// Contact me for web or mobile app development using React or React Native
// https://chengsokdara.github.io
import React, { createContext, useContext, useReducer } from "react";
import initialState from "./initialState"; // object of initial states
import reducer from "./reducer"; // https://reactjs.org/docs/hooks-reference.html#usereducer
const Store = createContext({
dispatch: () => null,
state: initialState,
});
@abobija
abobija / esp-idf on ubuntu 20.04.1.md
Last active September 9, 2023 02:20
ESP-IDF on Ubuntu 20.04.1

ESP-IDF on Ubuntu 20.04.1

This is commands used in youtube video

How to setup ESP-IDF on Ubuntu 20.04.1

Commands:

sudo apt update && sudo apt upgrade -y
@zvakanaka
zvakanaka / letsencrypt-ssl-nginx-multiple-sites.md
Last active May 3, 2023 16:46
Free HTTPS on nginx (and how to reverse proxy plain HTTP servers behind SSL AND serve multiple sites AND multiple apps)

Deploy Web Apps on a Linux Server (Multiple Apps & Multiple Domains)

Initial Setup (once per machine)

Install Certbot:

$ sudo apt install certbot

Stop any programs running on port 80 in order for certbot to communicate: $ sudo service nginx stop

Your email will only be asked for the 1st time:

When You Have the Spirit When You Do Not Have the Spirit
1. You generally feel happy and calm. You may feel unhappy, depressed, confused, frustrated most of the time.
2. You feel full of light. You may feel heavy, full of darkness.
3. Your mind is clear. Your mind may be muddled.
4. You feel love for the Lord and others. You may feel empty, hollow, cold inside.
5. You feel generous. You may feel selfish, possessive, self-centered.
6. Nobody can offend you. You may be offended easily.
7. You are very forgiving and kind. You may usually be on the defensive.
8. You feel confident in what you do. You may become discouraged easily.
@kkochubey1
kkochubey1 / The Technical Interview Cheat Sheet.md
Created June 26, 2017 14:44 — forked from Mohamed3on/The Technical Interview Cheat Sheet.md
This is a fork to fix the markdown errors in the original gist.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

Array

Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@jimmywarting
jimmywarting / readme.md
Last active July 22, 2024 15:13
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@zvakanaka
zvakanaka / chromebook-family-search.md
Last active February 13, 2018 21:28
FamilySearch Indexing on a Chromebook

NOTICE: Indexing is now available through any browser on familysearch.org/indexing

Running FamilySearch Indexing on a Chromebook is possible with Ubuntu. This guide shows how to put Ubuntu on a Chromebook, then how to start it from Ubuntu. This is not dual boot, neither is it a Virtual Machine. Ubuntu will be using the same Linux Kernel your ChromeOS is already using.

Warning

This has only been tested on my Acer C710. Do your research before putting your device in dev mode. If you brick your Chromebook from anything in this tutorial that's not my fault. I have had the recovery screen many times before and was able to restore with a USB drive, but you may not be so lucky.

1. Put your device in dev mode (what is dev mode?)

Note: This will wipe and reset your Chromebook
esc+refresh+power then

@ebidel
ebidel / fancy-tabs-demo.html
Last active July 16, 2024 04:56
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
<script src="https://unpkg.com/@webcomponents/custom-elements"></script>
<style>
body {
margin: 0;
}
/* Style the element from the outside */
/*
fancy-tabs {
margin-bottom: 32px;
@mattmeng
mattmeng / .bashrc
Last active January 2, 2018 17:06
.bashrc
GIT_PS1_SHOWCOLORHINTS=true
green="$(tput setaf 2)"
red="$(tput setaf 1)"
blue="$(tput setaf 4)"
yellow="$(tput setaf 3)"
white="$(tput setaf 7)"
bold="$(tput bold)"
reset="$(tput sgr0)"
PS1="\`if [[ \$? = "0" ]]; then echo '\n$green'; else echo '\n$red'; fi\`\$(s=\$(printf "%*s" \$COLUMNS); echo \${s// /-})\n \[$reset\]\[$blue\]\W\$(__git_ps1 \"\[$bold\](\[$reset\]\[$green\]%s\[$reset\]\[$blue\]\[$bold\])\") \[$reset\]\[$yellow\]\[$reset\]"
@ebidel
ebidel / ce_highlight.js
Last active July 5, 2018 20:14
Continuous custom element higlighter
// Continuously higlights the custom elements on the page. This is useful
// if new custom elements are lazy loaded later on or you have a SPA
// that uses other elements.
// CE finding code from: https://gist.github.com/ebidel/4bdbe9db55d8a775d0a4
(function() {
let cache = [];
function highlightCustomElements() {