Skip to content

Instantly share code, notes, and snippets.

View phsantiago's full-sized avatar
:shipit:

Pedro H. Santiago phsantiago

:shipit:
View GitHub Profile
@jhned
jhned / mza-snippet
Last active December 28, 2018 14:32
margin: 0 auto; gist for Emmet
{
"snippets": {
"css": {
"snippets": {
"mza": "margin: 0 auto;"
}
}
}
}
@igrigorik
igrigorik / github.bash
Last active December 22, 2023 23:55
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@javierarques
javierarques / gist:5444534
Last active April 6, 2017 14:34
Wordpress. Set custom template for taxonomies. Change default template. template_include filter
// Add the filter
add_filter( 'template_include', 'my_custom_template');
/**
* Returns customized templates for custom taxonomies
*
* @param string $template
* @return string
*/
function my_custom_template ( $template ) {
@afeld
afeld / gist:1254889
Created September 30, 2011 20:28
YouTube video ID regex
# Parses YouTube URLs directly or from iframe code. Handles:
# * Address bar on YouTube url (ex: http://www.youtube.com/watch?v=ZFqlHhCNBOI)
# * Direct http://youtu.be/ url (ex: http://youtu.be/ZFqlHhCNBOI)
# * Full iframe embed code (ex: <iframe src="http://www.youtube.com/embed/ZFqlHhCNBOI">)
# * Old <object> tag embed code (ex: <object><param name="movie" value="http://www.youtube.com/v/ZFqlHhCNBOI">...)
/(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/
$5 #=> the video ID
# test it on Rubular: http://rubular.com/r/eaJeSMkJvo
@charlieschwabacher
charlieschwabacher / mixins.scss
Created July 21, 2011 07:41
SCSS mixins for cross browser CSS3 border-radius, transition, gradient, and box shadow
//Cross browser CSS3 mixins
@mixin box-shadow($left, $top, $radius, $color) {
box-shadow: $left $top $radius $color;
-webkit-box-shadow: $left $top $radius $color;
-moz-box-shadow: $left $top $radius $color;
}
@mixin transition($property, $duration, $easing: linear) {
transition: $property $duration $easing;
@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",