Skip to content

Instantly share code, notes, and snippets.

View SketchingDev's full-sized avatar

Lucas SketchingDev

View GitHub Profile
@SketchingDev
SketchingDev / jrnl-save.sh
Created March 31, 2018 11:47
Bash function for saving commands and their output to jrnl (http://jrnl.sh/)
#!/bin/bash
# Save commands/output to jrnl - the command line journal
# 1. Install jrnl (http://jrnl.sh/)
# 2. Reference this file, or copy the function, into your bash profile
function save(){
SAVE_COMMAND=$(echo "$@")
SAVE_OUTPUT=$($@)
echo "$SAVE_OUTPUT"
echo -e "$SAVE_COMMAND\n$SAVE_OUTPUT\n@terminal" | jrnl
@SketchingDev
SketchingDev / DataUri.php
Created December 2, 2017 14:02
A convenient class for working with Data URIs in PHP
<?php
/* The MIT License (MIT)
* Copyright (c) 2015 FlyingTopHat (lucas@flyingtophat.co.uk)
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all