Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Holmes anthonyholmes

View GitHub Profile
@anthonyholmes
anthonyholmes / getMidiNumber.js
Created February 18, 2020 22:08
Note to Midi Number
View getMidiNumber.js
/**
* Get the midi note number of a note string
*
* @param {string} note
*
* @returns {number} MIDI note number
*/
function getMidiNumber(note) {
// Based on 1st octave of each note
@anthonyholmes
anthonyholmes / ParseLaravelSessionStorage.php
Last active January 21, 2020 22:28
Parse Session Driver for Laravel 5
View ParseLaravelSessionStorage.php
<?php
namespace App;
use Parse\ParseStorageInterface;
class ParseLaravelSessionStorage implements ParseStorageInterface
{
/**
* Parse will store its values in a specific key.
@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
View bootstrap-sass-mixin-cheatsheet.scss
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@anthonyholmes
anthonyholmes / SassMeister-input-HTML.html
Created June 26, 2014 23:12
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="container">
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
@anthonyholmes
anthonyholmes / fb_invite.js
Last active March 5, 2018 06:10
Facebook: Invite All Friends at Once
View fb_invite.js
// First, open your admin panel on your Facebook page
// Click See All in the "Invite Friends" section
// Scroll to the bottom of the popup window so all of your friends are loaded
// Open your Console in your development tools and enter this Javascript
elms=document.getElementsByClassName("uiButton _1sm");for (i=0;i<elms.length;i++){ elms[i].click()};
// If developer tools aren't enabled, paste this in your address bar
// Note: You might need to manually type the "javascript:" part if you paste
// this because Chrome strips it when you paste it.
@anthonyholmes
anthonyholmes / directory_tree.php
Last active December 30, 2015 02:59
Recursive Directory Tree into array
View directory_tree.php
<?php
$dir = __DIR__;
function gather($dir){
$tree = [];
$allFilesAndDirs = glob($dir."/*");
foreach($allFilesAndDirs as $f){
@anthonyholmes
anthonyholmes / vhost.rb
Last active December 14, 2015 23:48
Create virtual host from command line Syntax: sudo ruby vhost [path] [url] Note: Paths of your folders may be different
View vhost.rb
#!/usr/bin/ruby
# Get the path in the Sites folder
path = ARGV[0]
# Get the path in the Sites folder
url = ARGV[1]
if ARGV[2] == "third"
open('/etc/apache2/extra/httpd-vhosts.conf', 'a') { |f|
@anthonyholmes
anthonyholmes / spreadsheet.php
Last active June 23, 2018 14:58
PHP Class for Accessing Data from Google Docs Spreadsheet
View spreadsheet.php
<?php
Class DocDB {
private $key;
private $url;
private $file;
private $json;
private $rows;
private $data = array();
private $columns = array();