Skip to content

Instantly share code, notes, and snippets.

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

CJ Yancey cyancey76

🏠
Working from home
View GitHub Profile
@cyancey76
cyancey76 / hosts
Created May 13, 2017 05:58 — forked from consti/hosts
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@cyancey76
cyancey76 / translateY-center-vertical.sass
Last active September 22, 2017 21:01
Center anything vertically using translateY().
/* Vertically center whatever we want,
* even if we don’t know its height.
*/
.element {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: perspective(1px) translateY(-50%);
@cyancey76
cyancey76 / wp-insert-admin.sql
Created July 19, 2017 21:33
Add an admin account to WP via MySQL
INSERT INTO `wp_users`
(`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES
('newadmin', MD5('pass123'), 'firstname lastname', '[email protected]', '0');
INSERT INTO `wp_usermeta`
(`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES
(NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
@cyancey76
cyancey76 / svg-markup.html
Last active September 22, 2017 21:00
Svg markup and symbol svg for multiple icons.
<svg role="img" aria-labelledby="uniqueTitleID uniqueDescID" id="" class="" viewBox="# # # #" >
<title id="uniqueTitleID">Title</title> <!-- for screen readers, must be first child -->
<desc id="uniqueDescID">Title</desc> <!-- for screen readers -->
<g>
</g>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href=""></use>
</svg>
@cyancey76
cyancey76 / sticky-footer.css
Last active September 22, 2017 20:59
Sticky footer using flexbox.
@cyancey76
cyancey76 / bookmarklet.js
Created September 10, 2017 07:01
Javascript Bookmarklet
javascript: (function(){
var script = document.createElement('script');
script.id = '<name-here>';
script.type = 'text/javascript';
script.src = '<url-here>';
document.body.appendChild(script);
})();
@cyancey76
cyancey76 / selectors.css
Created September 14, 2017 16:43
CSS Selectors
* // All
#Z // ID
.Z // Class
X Y // Descendant
X // Element
@cyancey76
cyancey76 / mobile-nav-trigger-base.css
Last active September 22, 2017 21:09
CSS-only mobile nav trigger
.nav-trigger {
display: none;
}
.nav-trigger + label[for] {
display: inline-block;
box-sizing: border-box;
min-height: 40px;
min-width: 40px;
position: relative;
padding: 40px 8px 5px;
@cyancey76
cyancey76 / css-only-tabs.css
Created September 25, 2017 16:59
CSS-only tabs
.tabs {
width: 100%;
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
li {
width: 100%;
@cyancey76
cyancey76 / .htaccess
Last active September 19, 2019 16:51
.htaccess password protect #htaccess
AuthType Basic
AuthName "Password Protected Area"
AuthUserFile /path/to/.htpasswd
Require valid-user