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
@wess
wess / gist:c66382198d48238787718b9bb8e9f3d9
Created July 30, 2019 21:07
Start/End GCodes for BLTouch Ender 3
; Ender 3 Custom Start G-code
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
M104 S160; start warming extruder to 160
G28 ; Home all axes
G29 ; Auto bed-level (BL-Touch)
G92 E0 ; Reset Extruder
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
M109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature
<?php
namespace Appwrite\Auth;
class Metamask extends OAuth2
{
/**
* @return string
*/
public function getName(): string
@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
# ~/.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 \
; CR-1 Custom Start G-code
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
M104 S160; start warming extruder to 160
G28 ; Home all axes
G29 ; Auto bed-level (BL-Touch)
G92 E0 ; Reset Extruder
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
M109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature
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