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 / Initial Setup.md
Created June 24, 2018 11:05
Installing And Setting Up Arch Linux to Dual Boot Alongside Window 10

Newb's Guide to installing Arch Next to Pre-installed Windows 10

The steps I took to dual boot Arch Linux alongside the preinstalled Windows 10 that came with my new Lenovo Ideapad. I used Ubuntu exclusively for the last 6 years so I'm Window's illiterate. I don't know a whole lot about the inner workings of Linux either.

Pre-Instllation Steps

Prepare the preinstalled Windows to share the system.

Verify the boot mode...

@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 / Credit Card Generator
Last active August 14, 2023 14:33 — forked from B-Con/Credit Card Generator
Generate a valid random credit card number, CVV, issuer and expiration date
/**
* Generate a valid random credit card number, CVV, issuer and expiration date
*
* Original Copywrite/license:
*
* Copyright (c) 2015, Brad Conte (http: *bradconte.com)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@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 / Sending Apple push notifications with APN service and .p8 key .php
Created January 16, 2020 21:45
Sending Apple push notifications with APN service and .p8 key
<?php
// Path to the .p8 file downloaded from apple
// see: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns#2943371
$authKey = "AuthKey_S97G28Y3JP.p8";
// Team ID (From the Membership section of the ios developer website)
// see: https://developer.apple.com/account/
$teamId = 'asdfasdf';
@Pamblam
Pamblam / thread.js
Last active May 18, 2023 13:21
Creating disposable threads in javascript.
// Call the function with at least one parameter.
// The last parameter must be a function that will run on it's own thread
// Any params that are passed to Thread() will be available in the thread function
// The last param of the thread function must be
function Thread(){
return new Promise((resolve, reject)=>{
var args = Array.from(arguments);
var func = args.pop();
@Pamblam
Pamblam / Oracle To Mysql Geometry Conversion.php
Last active April 20, 2023 06:22
Convert Oracle Spatial to MySQL Spatial
<?php
/**
* Convert an Oracle SYS.SDO_GEOMETRY definition (perhaps extracted from an insert
* statement) to a MySQL Geometry column. This function only handles Polygons and
* Multipolygons.
*
* Example:
* $definition = "MDSYS.SDO_GEOMETRY(2003,4326,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(-75.01703,41.79308,-75.02978,41.7941,-75.02735,41.772,-75.02716,41.77193,-75.02697,41.77187,-75.01354,41.79051,-75.01337,41.79061,-75.0132,41.79072,-75.00949,41.79234,-75.00946,41.79254,-75.00943,41.79274,-75.00518,41.7943,-74.9995,41.79178,-74.99365,41.79788,-74.99383,41.79798,-74.99876,41.80318,-74.9988,41.80337,-74.99883,41.80349,-75.00425,41.80479,-75.00431,41.80459,-75.01239,41.79415,-75.01245,41.79412,-75.01688,41.79345,-75.01696,41.79327,-75.01703,41.79308))";
* $sql = "INSERT INTO mytable (geom) VALUES (".OraclePolygonToMysql($definition).")";
@Pamblam
Pamblam / text alignment with gd and .php
Created March 7, 2019 17:12
left, right, center and justify text in an image usign native php functions
<?php
$text = "Your Text Here
this is a test of the things and stuff and things";
$font_size = "12";
$color = "#000000";
$font_file = "/Applications/XAMPP/xamppfiles/htdocs/otcb/app/fonts/OldStreetSigns.ttf";
$background = "#FFFFFF";
$wrap_width = "250";
$alpha = 0;
@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;