Skip to content

Instantly share code, notes, and snippets.

View stevemckinney's full-sized avatar
🎨

Steve stevemckinney

🎨
View GitHub Profile
@una
una / text.md
Last active April 12, 2022 03:29
Cleanup Branches
  1. Go to the remote repo and delete outdated branches

  2. Then either:

    • Locally cleanup only merged branches: git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
  • Locally remove fetched, outdated branches: git for-each-ref --format='%(refname:short) %(upstream)' refs/heads/ | awk '$2 !~/^refs\/remotes/' | xargs git branch -D
@bendc
bendc / display-fade.html
Created June 22, 2016 03:01
Transitioning the opacity of a hidden element
<!doctype html>
<meta charset="utf-8">
<title>Example</title>
<style>
div {
width: 100px;
height: 100px;
background: black;
animation-duration: .5s;
@paulirish
paulirish / bling.js
Last active July 23, 2024 14:51
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@addyosmani
addyosmani / README.md
Last active July 24, 2024 10:54 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@rileypaulsen
rileypaulsen / functions.php
Created August 19, 2014 16:08
Add Advanced Custom Fields Fields to the WP REST API
function wp_api_encode_acf($data,$post,$context){
$data['meta'] = array_merge($data['meta'],get_fields($post['ID']));
return $data;
}
if( function_exists('get_fields') ){
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3);
}
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active July 26, 2024 20:21
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@larrybotha
larrybotha / A.markdown
Last active February 7, 2024 15:20
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

mymodule {
@at-root {
.#{&}-header { ... }
.#{&}-footer { ... }
.#{&}-body {
a { ... }
span { ... }
p { ... }
}
}
@abitgone
abitgone / gist:4596468
Created January 22, 2013 17:25
JavaScript-less Sharing Links
<!-- Twitter -->
<a href="https://twitter.com/intent/tweet?original_referer=REFERRER_URL&source=tweetbutton&text=TWEET_TEXT&url=URL&via=USERNAME">Share on Twitter</a>
<!-- Facebook -->
<a href="http://www.facebook.com/share.php?u=URL&t=TITLE">Share on Facebook</a>
<!-- Google+ -->
<a href="https://m.google.com/app/plus/x/?content=URL&v=compose&hideloc=1">Share on Google+</a>
<!-- Instapaper -->
@abpin
abpin / nginx.conf
Created September 21, 2012 02:00
nginx.conf File For ExpressionEngine or Codeigniter
server {
listen :80;
server_name www.example.com;
rewrite ^/(.*) http://example.com/$1 permanent;
}
server {
server_name example.com;
listen :80;