Skip to content

Instantly share code, notes, and snippets.

View stormwarning's full-sized avatar
👀

Jeff stormwarning

👀
View GitHub Profile
@stormwarning
stormwarning / open-graph.html
Created April 1, 2014 23:08
OpenGraph & Twitter Card meta tags.
<meta name="twitter:card" content="[summary]">
<meta name="twitter:site" content="[@handle]">
<meta name="twitter:creator" content="[@handle]">
<meta property="og:url" content="[url]">
<meta property="og:title" content="[title]">
<meta property="og:description" content="[summary]">
<meta property="og:image" content="[image url]">
@stormwarning
stormwarning / __wordpress.php
Last active February 29, 2024 03:03
WordPress PROTIPs
/**
* A selection of handy code snippets, plugins, and best practices for WordPress development.
*
*/
@stormwarning
stormwarning / magnific-youtu.js
Created June 26, 2015 15:05
Enable support for YouTube short URLs in Magnific Popup
$('.video').magnificPopup({
type: 'iframe',
iframe: {
patterns: {
youtu: {
index: 'youtu.be',
id: function( url ) {
// Capture everything after the hostname, excluding possible querystrings.
var m = url.match( /^.+youtu.be\/([^?]+)/ );
@stormwarning
stormwarning / is-visible.js
Last active June 6, 2020 22:10
Change an element's class when it comes into view.
/**
* Change class when element is in view
*/
var elementTop = $(".container").offset().top;
$(window).on("scroll", function updateClassWhenInView() {
if ($(window).scrollTop() > elementTop - window.innerHeight * 0.9) {
$(window).off("scroll", updateClassWhenInView);
$(".element").removeClass("is-hidden").addClass("is-visible");
}
@stormwarning
stormwarning / keybase-to-pgp
Created September 21, 2018 16:52
Error output when trying to import keybase key into pgp
❯ keybase pgp export -s | gpg --import --allow-secret-key-import
gpg: directory '/Users/SELF/.gnupg' created
gpg: keybox '/Users/SELF/.gnupg/pubring.kbx' created
gpg: /Users/SELF/.gnupg/trustdb.gpg: trustdb created
gpg: bad data signature from key 0XFOO: Wrong key usage (0x19, 0x2)
gpg: key 0XBAR: public key "keybase.io/USER <USER@keybase.io>" imported
gpg: bad data signature from key 0XFOO: Wrong key usage (0x19, 0x2)
gpg: key 0XBAR/0XBAR: error sending to agent: Inappropriate ioctl for device
gpg: error building skey array: Inappropriate ioctl for device
gpg: Total number processed: 1
@stormwarning
stormwarning / twitter-count.php
Created April 24, 2015 15:20
Get following/followers count of an Twitter account, without using 1.1 API
<?php
/**
* Get following/followers count of an Twitter account, without using 1.1 API
* @author Lancelot HARDEL
* @param username That's clear
* @param cache If you want to enable cache (or not)
* @param cachetime Time that the cachefile is valied
* @param stat_name you can use two values : followers, or following
* @return int
*/
@stormwarning
stormwarning / tooltip.js
Created May 21, 2017 20:10
Tooltip script from culturedcode.com
tooltip = {
elements: void 0,
CLASS_BUBBLE: "tooltip-bubble",
CLASS_CONTENT: "tooltip-content",
CLASS_HEADER: "tooltip-header",
CLASS_FOOTER: "tooltip-footer",
STATE_INIT: "is-initialized",
STATE_VISIBLE: "is-visible",
init: function(e) {
this.elements = e;
{
"plugins": [
"stylelint-order",
"stylelint-scss"
],
"extends": [
"stylelint-config-recess-order"
],
"rules": {
"color-hex-case": "lower",
@stormwarning
stormwarning / mixin--opacity.scss
Created January 17, 2014 23:36
Easy cross-browser opacity.
/**
* Cross-browser opacity.
*
* 1. Even IE8
*
* Usage:
*
@include opacity(0.8);
*
*/
@stormwarning
stormwarning / __constructs.html
Last active January 2, 2016 04:09
Semantic content constructs
<!--
Clean, efficient, complex content elements.
-->