Skip to content

Instantly share code, notes, and snippets.

jsmeltzer

Block or report user

Report or block jsmeltzer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jsmeltzer
jsmeltzer / scroll-to-anchor.js
Created Jun 13, 2017
Simple Scroll to Anchor using jQuery
View scroll-to-anchor.js
// REF https://stackoverflow.com/questions/3163615/how-to-scroll-html-page-to-given-anchor-using-jquery-or-javascript
jQuery(document).ready(function($){
$(document).on('click', 'a.scroll-to', function(e) {
e.preventDefault();
scrollToAnchor( $(this).attr('href') );
});
});
function scrollToAnchor(aid){
var aTag = jQuery(aid);
@jsmeltzer
jsmeltzer / functions.php
Created Jun 8, 2017
Add new WordPress user via FTP
View functions.php
<?php
//REF http://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-in-wordpress-using-ftp/
function wpb_admin_account(){
$user = 'Username';
$pass = 'Password';
$email = 'email@domain.com';
if ( !username_exists( $user ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
View flexbox-align.css
.aligner {
display: flex;
align-items: center;
}
.aligner-center {
display: flex;
align-items: center;
justify-content: center;
}
@jsmeltzer
jsmeltzer / style.css
Last active Dec 20, 2016
CSS Blur Content
View style.css
body.spam table[data-restricted="true"] {
-webkit-filter: blur(0.8px);
filter: blur(0.8px);
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50) progid:DXImageTransform.Microsoft.Blur(PixelRadius='0.8');
opacity: 0.5;
}
@jsmeltzer
jsmeltzer / speedTest.js
Created Jun 24, 2015
JavaScript Speed Test Class From Code School
View speedTest.js
/*
Speed Test Class
Tests a code block X number of times and returns an average of the execution time
https://www.codeschool.com/courses/javascript-best-practices
*/
var SpeedTest = function(testImplement,testParams,repetitions){
this.testImplement = testImplement;
this.testParams = testParams;
@jsmeltzer
jsmeltzer / 0_reuse_code.js
Created Jun 4, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.