Skip to content

Instantly share code, notes, and snippets.

View stanwmusic's full-sized avatar
🏠
Working from home

Stan Williams stanwmusic

🏠
Working from home
View GitHub Profile
@stanwmusic
stanwmusic / 0_reuse_code.js
Created March 20, 2014 03:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@turquoise: #95A5A6;
@emerald: #2ECC71;
@peter-river: #3498DB;
@amethyst: #9B59B6;
@wet-asphalt: #34495E;
@green-sea: #16A085;
@nephritis: #27AE60;
@belize-hole: #2980B9;
@wisteria: #8E44AD;
@midnight-blue: #2C3E50;
/*
To use it:
require(['video'], function(Video){
var video = new Video('.video');
// optionally, you can either drag a video file over the .video element
video.playvideo('a valid video url');
});
*/
@stanwmusic
stanwmusic / contact.html
Created February 6, 2016 16:42 — forked from ajtroxell/contact.html
Build a simple PHP, jQuery, and AJAX Powered Contact Form, from: http://ajtroxell.com/build-a-simple-php-jquery-and-ajax-powered-contact-form/
<form id="contact" name="contact" method="post">
<fieldset>
<label for="name" id="name">Name<span class="required">*</span></label>
<input type="text" name="name" id="name" size="30" value="" required/>
<label for="email" id="email">Email<span class="required">*</span></label>
<input type="text" name="email" id="email" size="30" value="" required/>
<label for="phone" id="phone">Phone</label>
<input type="text" name="phone" id="phone" size="30" value="" />
function checkForCloseMatch(longString, shortString) {
// too many false positives with very short strings
if (shortString.length < 3) return '';
// test if the shortString is in the string (so everything is fine)
if (longString.includes(shortString)) return '';
// split the shortString string into two at each postion e.g. g|mail gm|ail gma|il gmai|l
for (let i = 1; i < shortString.length; i++) {
const firstPart = shortString.substring(0, i);
@stanwmusic
stanwmusic / bootstrap_3_full_class_list
Created April 3, 2017 03:50 — forked from cosmicscr/bootstrap_3_full_class_list
bootstrap 3 full class list
Here are all the classes from Bootstrap 3 (version 3.1.1).
Method of extraction:
1. Download Bootstrap 3 and rename bootstrap.css as "bootstrap.html"
2. Add the following 24 lines of code to the very bottom of the bootstrap.html file:
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script>
@stanwmusic
stanwmusic / Bootstrap-3_Carousel-Collection
Created June 13, 2017 00:39 — forked from loschke/Bootstrap-3_Carousel-Collection
Bootstrap 3 - Carousel Collection Pack
@stanwmusic
stanwmusic / clean-up-boot-partition-ubuntu.md
Created January 30, 2018 01:54 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@stanwmusic
stanwmusic / activate-plugin.php
Created February 19, 2018 09:26 — forked from solepixel/activate-plugin.php
Originally design to activate Andrew Norcross's Airplane Mode plugin (https://github.com/norcross/airplane-mode), this little script will allow you to activate a plugin when the WordPress admin plugin screen cannot be loaded, for whatever reason.
<?php
/**
* This file will activate the Airplane Mode plugin if not already activated. This is helpful when you do not have internet connection and you're unable to reach the WP Admin Plugins page to activate the plugin.
*/
// get WP bootstrap
define('WP_USE_THEMES', false);
require(__DIR__ . '/wp/wp-blog-header.php');