Skip to content

Instantly share code, notes, and snippets.

View wess's full-sized avatar
💭
When am I not writing code?

Wess Cope wess

💭
When am I not writing code?
View GitHub Profile
<?php
namespace Appwrite\Auth;
class Metamask extends OAuth2
{
/**
* @return string
*/
public function getName(): string
# ~/.bashrc or ~/.zshrc
# Direnv setup
eval "$(direnv hook bash)" # or 'zsh' if you're using zsh
# Asdf setup (assuming you've set up asdf as per its documentation)
. $HOME/.asdf/asdf.sh
# Custom 'use' command for direnv
use_asdf() {
FROM phpswoole/swoole:php8.1
RUN apt-get update && \
apt-get install -y -q \
apt-utils \
zsh \
nano \
vim \
make \
locales \
curl -X 'PATCH' \
'https://api.ote-godaddy.com/v1/domains/bestqnypcb.net' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: sso-key <removed-for-safey>' \
-d '{
"nameServers": ["ns1.example.com","ns2.example.com"],
"consent": {
"agreedAt": "2023-02-07T15:12:16.000Z",
"agreedBy": "127.0.0.1",
CREATE EXTENSION IF NOT EXISTS plpgsql;
CREATE TABLE doc_store (
key text PRIMARY KEY,
value json
);
CREATE OR REPLACE FUNCTION insert_key_value(p_key text, p_value json)
RETURNS void AS $$
BEGIN
@wess
wess / example.ts
Created February 2, 2023 14:36
Knex based query generator
import YourKnexConnection from './connection';
import Schema from './schema';
import Provider from './provider';
interface User extends Schema {
email:string;
password:string;
}
const userProvider = Provider<User>(YourKnexConnection, 'users_table');
CREATE EXTENSION IF NOT EXISTS plpgsql;
CREATE TABLE doc_store (
key text PRIMARY KEY,
value json
);
CREATE OR REPLACE FUNCTION insert_key_value(p_key text, p_value json)
RETURNS void AS $$
BEGIN
class OnboardingScreen extends StatefulWidget {
const OnboardingScreen({Key? key}) : super(key: key);
@override
_OnboardingScreenState createState() => _OnboardingScreenState();
}
class _OnboardingScreenState extends State<OnboardingScreen> {
final TextEditingController _nameController = TextEditingController();
#!/usr/bin/env bash
export SODA_SCRIPTS_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source ${SODA_SCRIPTS_ROOT}/__echo.sh
#### Websocket Setup
SERVER_PORT=3333
WS_PIPE=/tmp/_websocket.tmp
IN_PIPE=/tmp/_in_websocket.tmp
@wess
wess / websocket_server.sh
Created November 10, 2021 20:47
Websocket Server in Bash [poc]
#!/usr/bin/env bash
IN_PIPE=$1;
_hex() {
typeset num=`echo 'obase=16; ibase=10; '"$1" | bc`
if ((${#num} == 1)); then
num=0"$num"
fi