Skip to content

Instantly share code, notes, and snippets.

View codebykyle's full-sized avatar
🏠
Working from home

CodeByKyle codebykyle

🏠
Working from home
  • Ho Chi Minh City, Vietnam
View GitHub Profile
@codebykyle
codebykyle / bracket.scad
Created July 17, 2022 19:31
3D printed wire and tube holder
/***************************
******* USER PARAMS *******
**************************/
/* [Resolution Options] */
// Resolution of the mode.
// Lower values render faster.
// Higher values are smoother.
$fn = 100;
/* [Global Options] */
@codebykyle
codebykyle / run.py
Created April 24, 2022 09:26
Delete kubernetes namespaces which are not deleting due to finalizers
import requests
import json
namespaces_response = requests.get('http://127.0.0.1:8001/api/v1/namespaces').json()
for namespace_item in namespaces_response['items']:
if namespace_item['status']['phase'] == 'Terminating':
url = 'http://127.0.0.1:8001/api/v1/namespaces/%s' % namespace_item['metadata']['name']
namespace_get_data = requests.get(url).json()
@codebykyle
codebykyle / gist:f80d02ea2b16075c656fe533cd9831dd
Created March 22, 2022 14:48
Quickbooks Online bulk delete transactions
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function deleteTopTransaction() {
$('.dgrid-row')[0].click();
await sleep(250);
@codebykyle
codebykyle / connect.ps1
Last active March 28, 2024 05:10
Windows Terminal Split Pane Powershell Script - v2
using namespace System.Collections.Generic
# Encapsulate an arbitrary command
class PaneCommand {
[string]$Command
PaneCommand() {
$this.Command = "";
}
@codebykyle
codebykyle / YourResourceClass.php
Created August 6, 2019 17:07
Split Fields Function Example Usage
class ExampleUsage extends Resource
{
...
public function fieldsIndex(Request $request)
{
return [
...
];
}
@codebykyle
codebykyle / Resource.php
Created August 6, 2019 17:04
Laravel Nova Split Resource Field Functions
<?php
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Heading;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Resource as NovaResource;
use Laravel\Nova\Http\Requests\NovaRequest;
@codebykyle
codebykyle / base resource
Last active July 14, 2019 09:22
Breaking up nova field definitions
<?php
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Heading;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Resource as NovaResource;
use Laravel\Nova\Http\Requests\NovaRequest;
@codebykyle
codebykyle / node_js_serial_port_thermal_printer
Created March 25, 2019 04:42
Serial port thermal printer / cash register control for Electron/NodeJS
const fs = require('fs');
const SerialPort = require('serialport');
const _ = require('lodash');
const BARCODE_TYPES = {
upc_a: 0,
epc_e: 1,
ean13: 2,
ean8: 3,
code39: 4,
@codebykyle
codebykyle / skillup.lua
Created March 18, 2018 11:04
Use skillup tomes
_addon.name = 'skillup'
_addon.author = 'Senotaru (Asura)'
_addon.version = '0.0.1'
_addon.lastUpdate = "2018.18.03"
_addon.commands = {'skillup'}
require('luau')
require('tables')
require('strings')
function getVtime(rawVtime)
local m = rawVtime % 60
local h = (rawVtime - m)/60
return '%s:%s%s':format(h, (m < 10 and '0' or ''), m)
end
function getVanadielTime()
local basisTime = os.time{year=2002, month=6, day=23, hour=11, min=0} --FFXI epoch
local basisDate = os.date('!*t', basisTime)