Skip to content

Instantly share code, notes, and snippets.

View hsnyc's full-sized avatar
🎯
Focusing

Henry hsnyc

🎯
Focusing
View GitHub Profile
@hsnyc
hsnyc / responsive-video.css
Last active January 29, 2017 01:59
Use to make an iframe video responsive
.video-container {
position: relative;
padding-bottom: 75%;
padding-top: 25px;
overflow: hidden;
margin-bottom: 20px;
}
.video-container iframe {
position: absolute;
@hsnyc
hsnyc / scroll.js
Last active January 29, 2017 03:10
Use to scroll to a section on the page
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 2000, 'easeOutBack');
return false;
@hsnyc
hsnyc / back-to-top.css
Last active January 29, 2017 03:47
Back to Top Script with easing
#back-to-top {
position: fixed;
bottom: 40px;
right: 40px;
z-index: 9999;
width: 32px;
height: 32px;
text-align: center;
line-height: 30px;
background: #f5f5f5;
@hsnyc
hsnyc / select.css
Last active February 14, 2017 22:19
Select Input - remove style for webkit browsers and add custom drop down icon
select {
-webkit-appearance: none;
-webkit-border-radius: 0px;
background: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'><path fill='#444' d='M7.406 7.828l4.594 4.594 4.594-4.594 1.406 1.406-6 6-6-6z'></path></svg>");
background-color: #ffffff;
background-position: 100% 50%;
background-repeat: no-repeat;
}
/* You should use a more specific selector appropiate to your project
@hsnyc
hsnyc / changeurl.php
Last active February 17, 2017 19:46
Changing the Site URL via wp-config.php file
/* Changing the Site URL for local testing */
define('WP_HOME', 'http://mytestingurl.com');
define('WP_SITEURL', 'http://mytestingurl.com');
/* https://codex.wordpress.org/Changing_The_Site_URL */
@hsnyc
hsnyc / removeeditor.php
Last active February 18, 2017 17:32
Remove Wordpress Theme Editor
/* Hide Theme Editor Menu */
function remove_editor_menu() {
remove_action('admin_menu', '_add_themes_utility_last', 101);
}
add_action('_admin_menu', 'remove_editor_menu', 1);
/* add to your themes funtions.php file to hide the theme editor menu option.
You can still access the editor from the url: http://mywebsite.com/wp-admin/theme-editor.php
*/
@hsnyc
hsnyc / .gitignore
Last active February 24, 2017 00:36
Ignore everything in the sites directory except the app/public folder
#Sample Directory Structure
# root (git repo)
# /(WordPress Site 1)/app/public/wp-content/themes
# /(WordPress Site 2)/app/public/wp-content/themes
# /(WordPress Site 3)/app/public/wp-content/themes
# Ignores everything in the site's directories except the `app/public` folder.
/*/*
!*/app
*/app/*
@hsnyc
hsnyc / keybase.md
Created April 4, 2017 13:45
Keybase Identity Check

Keybase proof

I hereby claim:

  • I am hsnyc on github.
  • I am hsnyc (https://keybase.io/hsnyc) on keybase.
  • I have a public key whose fingerprint is 2B66 14BF E964 DE6E 0381 FE03 AA1A 0ABC 8B4A 5097

To claim this, I am signing this object:

@hsnyc
hsnyc / scroll-to-top-bttn.css
Last active March 30, 2019 16:59
When the user scrolls down 1020px from the top of the document, show a button that will scroll back to the top of the page
/* Back to Top Icon */
#btt-icon {
width: 46px;
height: 50px;
position: fixed;
bottom: 40px;
right: 40px;
background-color: rgba(136, 136, 136, 0.18);
cursor: pointer;
border-radius: .2rem;
@hsnyc
hsnyc / functions.php
Last active March 30, 2019 17:26
Custom Wordpress Login Page
/* place this code in your functions.php file */
/*=== LOGIN Page Functions Start ===*/
//Loads the login page css styles
function custom_login() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/login/login-styles.css" />';
}
add_action('login_head', 'custom_login');