Skip to content

Instantly share code, notes, and snippets.

View Pamblam's full-sized avatar
🕶️
Coding

Rob Parham Pamblam

🕶️
Coding
  • Our Town America
  • Tampa Bay, Florida
View GitHub Profile
@Pamblam
Pamblam / readme.md
Last active October 31, 2024 18:53
Set class completion goals for WGU

WGU Goal Setter

This is meant to be run in your browser's dev tools. Copy the code, but change the two dates near the top.

It will calculate:

  1. Your projected completion date, based on how many CU's you've already completed.
  2. Start and End goal dates for each of your remaining courses.

Example output:

@Pamblam
Pamblam / UnixPermissions.php
Last active August 24, 2024 13:47
Class to manupilate and convert unix-style permissions
<?php
/**
* Class to manupilate and convert unix-style permissions
* example: UnixPermissions::fromString('rw-rw-rw-')->asNumeric() // 666
* example: UnixPermissions::fromNumeric(666)->unset('group', 'read')->asNumeric() // 626
* example: UnixPermissions::fromNumeric(646)->set('group', 'write')->asString() // 'rw-rw-rw-'
* example: UnixPermissions::fromString('rw-rw-rw-')->can('group', 'read') // true
*/
class UnixPermissions{
/**
* An example of a singleton that does some polling for an event
* and calls a callback when the event is fired.
*/
import 'dart:async';
void main() {
print("Running..");
@Pamblam
Pamblam / generate_flutter_icons.sh
Created July 31, 2024 16:58
Bash script to generate iOS and Android app icons for a Flutter project.
#!/bin/bash
# Given a square icon image file and a path to a flutter project,
# this will update the android and ios icon images for the project.
# Usage: generate_flutter_icons.sh -i /path/to/icon.png -p /path/to/project
# Note: -p flag can be omitted if the current working directory is
# the target flutter project.
while getopts i:p: flag
do
@Pamblam
Pamblam / reformat.js
Created May 16, 2024 14:44
run in the console to convert js strings containing HTML to formatted template strings
(async ()=>{
let val = document.querySelector('textarea') ? document.querySelector('textarea').value : '';
document.body.innerHTML = `<textarea style='width: 100vw; height: 100vh'></textarea>`;
document.querySelector('textarea').value = val;
document.querySelector('textarea').addEventListener('input', function(){
oninput(this.value)
});
if(val) oninput(val);
function oninput(str){
@Pamblam
Pamblam / animate.html
Created February 5, 2024 19:51
reusable javascript css animation function demo
<!DOCTYPE html>
<html>
<head>
<title>aminate</title>
</head>
<body>
<img id='img' src="https://static-00.iconduck.com/assets.00/heart-emoji-2048x1891-k5awv4hw.png"
style="position:absolute; left:0; top:0; width: 50px;" />
@Pamblam
Pamblam / VCard.class.js
Created July 28, 2023 12:43
VCard Implementtaion in Javascript
// See: https://www.rfc-editor.org/rfc/rfc6350
class VCard{
constructor(){
this.kind = null;
this.name = [];
this.nickname = [];
this.photo = [];
this.bday = null;
@Pamblam
Pamblam / minibeast_md_parser.js
Last active February 16, 2023 03:01
Convert specific allowed MD elements to HTML, as used in the Minibeast app and website.
/**
* Convert a string containing Markdown links, images, codeblocks, inline code, bold and italic text to an HTML string.
* 1. Remove duplicate linebreaks and spaces (including <br>)
* 2. Convert linebreaks to <br>
* 3. Convert URLs that are not part of a markdown tag to markdown tags
* 4. Convert ``` MD code blocks to <pre><code> blocks
* 5. Convert ` inline code to <code> tags
* 6. Convert ** bold tags to <b> tags
* 7. Convert * italics tags to <i> tags
* 8. Convert ![]() image tags to <img> tags
/**
* Remove <script> tags from a string
* We cannot use regex to remove them because regex does not
* account for false closing script tags, and therefore a regex solution is exploitable.
* This loops through each char and removes script tags fully accounting for
* false closes that may occur in quotes.
*/
function stripScriptTags(str){
if(typeof str !== 'string') {
return false;
@Pamblam
Pamblam / Convert AAX to M4B.sh
Last active October 11, 2022 17:10
Convert and decrypt Audible books to split up audiobook, retain meta data and split into chepters. Compatible with Mac.
# Converting Audible AAX files to M4B Audiobook files, split into chapters and decrypted
# Get activation bits here for now: https://audible-converter.ml
SHORTNAME='BeautifulYou'
AAXFILE='/Users/rob/Downloads/BeautifulYou_ep6.aax'
ACTIVATION_BYTES='2758110a'
# These files don'e exist yet, we just need to tell the script where to create them.
DATAFILE='/Users/rob/Desktop/audible-conv/data.json'
METADATAFILE='/Users/rob/Desktop/audible-conv/data.tmp'