Skip to content

Instantly share code, notes, and snippets.

View davidabram's full-sized avatar
🐊
Work, work.

David Abram davidabram

🐊
Work, work.
View GitHub Profile
#!/bin/bash
#
# Description: Text to speech using pico2wave
#
# sudo apt install libttspico-utils
#
# sudo apt install sox
#
#
# sudo mkdir -p /etc/apt/keyrings
@davidabram
davidabram / IsCalledOnce.tsx
Created September 7, 2022 11:56
UseEffect woes
import { useEffect, useState, useRef } from "react";
const IsCalledOnce = () => {
const [result, setResult] = useState({});
const [numberOfCalls, setNumberOfCalls] = useState(0);
const httpBinLoadingRef = useRef<boolean>(false);
const callHTTPBin = async (num: Number) => {
httpBinLoadingRef.current = true;
const response = await fetch(`https://httpbin.org/get?num=${num}`);
@davidabram
davidabram / PostgreSQL_index_naming.rst
Created February 21, 2021 15:44 — forked from popravich/PostgreSQL_index_naming.rst
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
Verifying my Blockstack ID is secured with the address 1GNjhqyPqFH34rik4h8LFneSJxMyqhLcCX https://explorer.blockstack.org/address/1GNjhqyPqFH34rik4h8LFneSJxMyqhLcCX
Verifying my Blockstack ID is secured with the address 1GNjhqyPqFH34rik4h8LFneSJxMyqhLcCX https://explorer.blockstack.org/address/1GNjhqyPqFH34rik4h8LFneSJxMyqhLcCX
#! /bin/bash
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
# Unzip
unzip protoc-3.6.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
/*
* Creates a new websocket client that connects to the Loom Instance
*/
const client = new Client(
'default',
'ws://127.0.0.1:46658/websocket',
'ws://127.0.0.1:46658/queryws',
)
/*
* Creates our Elasticsearch client
pragma solidity ^0.4.24;
contract HackerNoon {
struct Story {
string title;
string text;
address owner;
}