Skip to content

Instantly share code, notes, and snippets.

View dotspencer's full-sized avatar

Spencer Smith dotspencer

View GitHub Profile
@dotspencer
dotspencer / Sorting.java
Created February 18, 2016 01:42
A class that contains static sorting methods. Including Quicksort.
package testing;
import java.util.Comparator;
public class Sorting {
public static <T> void quicksort(T[] array, Comparator<? super T> comp) {
quicksort(array, comp, 0, array.length - 1);
}
@dotspencer
dotspencer / README.md
Last active November 10, 2016 00:18
Current Projects Map Shortcode

[google-map-2] shortcode

@dotspencer
dotspencer / README.md
Last active May 16, 2016 15:12
Forge map shortcode and marker data.

[forge_map] shortcode

@dotspencer
dotspencer / code.php
Last active March 15, 2016 21:01
Template for email contact overlays
echo '
<h2 id="peer-assist-link">Dedicated Peer Assist with EGI Scientists</h2>
<div id="peer-assist-overlay" style="display: none;"><div id="peer-assist-close"><img src="/wp-content/uploads/2014/07/button-close-black.png"/></div>[contact-form-7 id="13584" title="Benefits Page Contact (Peer Assist)"]</div>';
@dotspencer
dotspencer / code.php
Last active March 16, 2016 15:01
Training page helper
echo "";
@dotspencer
dotspencer / notepad.md
Last active March 24, 2016 20:47
Browser quick-edit notepad

Paste into new tab:

data:text/html,

@dotspencer
dotspencer / script.js
Created March 17, 2016 01:58
Current time of youtube video
ytplayer = document.getElementById("movie_player");
ytplayer.getCurrentTime();
@dotspencer
dotspencer / stopper.user.js
Created March 17, 2016 03:54
Youtube Auto-stopper Shortcode
// ==UserScript==
// @name Youtube Stopper
// @namespace http://spencerlarry.com/
// @version 0.1
// @description Automatically stops the video before it gets to the end and shows suggested videos.
// @author You
// @match https://www.youtube.com/watch?v=z_CfRxf3kPI&enablejsapi=1
// @include http*://www.youtube.com/watch?*
// @grant none
// ==/UserScript==
@dotspencer
dotspencer / style.css
Created March 22, 2016 22:53
Reverse screen extension idea. Add this to <html>
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
@dotspencer
dotspencer / words.txt
Last active March 24, 2016 21:40
Create WordPress Admin Account Using FTP/PHP (and other iCORDS things)
Create WordPress Admin Account Using FTP/PHP
April 25, 2012
Here is a little snippet which can create a WordPress backend account with ease using the FTP, just paste this PHP snippet in the active theme’s functions.php and the account will be created. Also, make sure the username and the email are unique, or the function will fail.
function admin_account(){
$user = 'AccountID';
$pass = 'AccountPassword';
$email = '[email protected]';
if ( !username_exists( $user ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );