Skip to content

Instantly share code, notes, and snippets.

Being Awesome

Rob Parham Pamblam

Being Awesome
Block or report user

Report or block Pamblam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Echo's discipline agreement .md

Echo's discipline agreement.

Every night we will review this list and calculate your point total for the day. For each rule you break you will lose points. You do not gain points for following rules just like the government doesn't reward you for following the law. You gain points for doing your chores and lose them when you do not do a chore. You may gain points for doing extra credit behaviours, but you will not lose points for not doing these. At the end of each day you are required to have a minimum of 2.5 points. You may choose from the demerits section to make up insufficient points. points earned via demerits do not earn a reward. Every 2 weeks your points will be cashed out at the rate of $1 per point. The first $10 you earn each period goes into a savings account and you may spend the rest as you choose.


  • 1pts Do all chores.
  • 5pts Be Honest.
  • .5 pts Remember phone/wallet/keys.
Pamblam /
Created Jul 12, 2019
Making High-Quality screencast animated gifs (Gnome Linux)

Making High-Quality screencast animated gifs

  1. Use any screen recorder to record the screen. Gnome has a built-in recorder that is started and stopped with ctrl+shift+alt+r.
  2. Use kdenlive's edgecrop and speed effects to crop and adjust speed as required. render as mp4.
  3. Convert MP4 to several images:
sudo ffmpeg -i save_project.mp4  -r 20 'frames/frame-%03d.jpg'
  1. Use gimp to determine coordinates of required crop
Pamblam / thread.js
Last active Jun 25, 2019
Creating disposable threads in javascript.
View thread.js
// 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 / levenshteinMatches.php
Created Mar 12, 2019
Find the closest matches to a given word.
View levenshteinMatches.php
$here = realpath(dirname(__FILE__));
$handle = fopen("$here/wordlist.txt", "r") or die("Couldn't get handle");
$matches = levenshteinMatches($handle, $_GET['word']);
echo "<pre>";
Pamblam / runcmd.php
Last active Mar 11, 2019
run a command
View runcmd.php
* Run a command with optional stdin
* @param string $cmd - the command to run
* @param string|string[] $stdin - the stdin to feed to the command
* @param string $cwd - the working directory in which to run the command
* @return object containing exit_status, stdout, stderr and elapsed
function runcmd($cmd, $stdin=null, $cwd=null){
Pamblam / text alignment with gd and .php
Created Mar 7, 2019
left, right, center and justify text in an image usign native php functions
View text alignment with gd and .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 / fetch examples .js
Last active Mar 18, 2019
View fetch examples .js
// GET request with data, JSON response
function getJson(url, params={}){
var url = new URL(url);
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]))
return fetch(url)
// POST request with data, JSON response
Pamblam / checksum.js
Created Feb 1, 2019
generate a checksum for a list of files to ensure project integrity
View checksum.js
// This is 3 different files concatted for simplicity.
// use in browser or via node to generate the checksum
var files = [
Pamblam / deep_compare.php
Created Jan 8, 2019
compare 2 data structures
View deep_compare.php
* compare 2 data structures.
* - Doesn't handle things like NaN that don't compare.
* - returns true if $b has all the same properties as $a and all properties have same values.
function deepCompare($a, $b){
Pamblam / color_helper.js
Created Jan 7, 2019
get a primary and secondary color name, estimated color name, and brightness from an rgb color and generate random colors
View color_helper.js
class Color {
constructor(rgb) {
this.rgb = rgb;
this.colormap = {
"110": "yellow",
"101": "magenta",
"011": "cyan",
"100": "red",
You can’t perform that action at this time.