Skip to content

Instantly share code, notes, and snippets.

View SketchBookkeeper's full-sized avatar
:octocat:
git status

Paul Allen SketchBookkeeper

:octocat:
git status
View GitHub Profile
/**
* Use this class to ensure Google Maps API javascript is loaded before running any google map specific code.
*/
export class GoogleMapsApi {
/**
* Constructor set up config.
*/
constructor() {
// api key for google maps
@SketchBookkeeper
SketchBookkeeper / plugin.js
Created June 19, 2018 21:14
Idea for a modal plugin
//--------------------------------------------------------------
// Modal
//--------------------------------------------------------------
export const Modals = (function() {
function BuildModals() {
let publicAPIs = {};
/**
@SketchBookkeeper
SketchBookkeeper / custom.js
Last active June 13, 2018 21:44
Check if string can be parsed to an Object.
function isJson(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
// Connect to database
$connection = mysqli_connect('localhost, 'root', 'root', 'test');
// Write
$query = "INSERT INTO users(username, password) ";
$query .= "VALUES ('$username', '$password')";
mysqli_query($connection, $query);
// Read
//--------------------------------------------------------------
// MODAL
//--------------------------------------------------------------
// Overlay
.c-modal {
align-items: center;
background-color: rgba(128,128,128,0.4);
bottom: 0;
display: flex;
justify-content: center;
  1. PixelSnap - Mesure Designs (purchased)
  2. Alfred - Search
  3. Magnet - Sort Windows (purchased)
  4. CopyClip - Copy History (purchased)
  5. iTerm2 - Terminal
  6. Sequal Pro - SQL
  7. Postman - Test API Calls
  8. GitKraken - GIT GUI
  9. Giphy Capture - GIFS
  10. ImageOptim - Compress Images
/**
* ScrollTo
*
* @param {String} linkSelector CSS class of links to watch for animated scroll
* @returns null
*/
const ScrollTo = (function(linkSelector) {
const BuildScrollTo = function(linkSelector) {
@SketchBookkeeper
SketchBookkeeper / README.md
Last active April 12, 2018 16:32
For the Mac
@SketchBookkeeper
SketchBookkeeper / bling.js
Created March 29, 2018 14:33 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
/**
* Check for Empty Array, returns true if the array is not empty
* @author Paul Allen
* @see https://stackoverflow.com/questions/8328983/check-whether-an-array-is-empty
* @param Array
* @return boolean
*/
function base_check_for_empty_array( $array ) {
if ( 'array' !== gettype( $array ) ) {