Skip to content

Instantly share code, notes, and snippets.

View yumyo's full-sized avatar

Giulia Nicole Pernice yumyo

View GitHub Profile
@yumyo
yumyo / Kaleidoscope Git integration (AppStore version)
Last active January 3, 2016 11:19
Add this lines to your ~/.gitconfig to use Kaleidoscope as the default Git difftool & mergetool. Thanks to Nathan Cahill bit.ly/Lj0j6s
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
sudo /System/Library/Extensions/TMSafetyNet.kext/Helpers/bypass rm -rfv /Volumes/[disk]/Backups.backupdb/[path]
@yumyo
yumyo / gist:9761973
Created March 25, 2014 13:40
HTML spaces
Including, but not limited to:
non breaking space :  
en space :   or  
em space :   or  
3-per-em space :  
4-per-em space :   
6-per-em space :   
figure space :   
punctuation space :   
add_filter( 'walker_nav_menu_start_el', 'gt_add_menu_item_description', 10, 4);
function gt_add_menu_item_description( $item_output, $item, $depth, $args ) {
$desc = __( $item->post_content );
return preg_replace('/(<a.*?>[^<]*?)</', '$1' . "<small class=\"nav-desc\">{$desc}</small><", $item_output);
}
// expand {{PATTERNS}}
// You can do this serverside. I just did it this way for demonstration purposes.
(function () {
"use strict";
var shares = document.querySelectorAll("ul.share > li > a");
var keywords = document.querySelector('meta[name=keywords]').getAttribute("content");
var description = document.querySelector('meta[name=description]').getAttribute("content");
var params = {
URL: encodeURIComponent(document.querySelector('link[rel=canonical]').getAttribute("href")),
@yumyo
yumyo / deploy.sh
Last active September 7, 2015 09:04
Wordpress plugin GIT -> SNV deploy script
#! /bin/bash
#
# Script to deploy from Github to WordPress.org Plugin Repository
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# Source: https://github.com/thenbrent/multisite-user-management/blob/master/deploy.sh
#prompt for plugin slug
echo -e "Plugin Slug: \c"
read PLUGINSLUG
@yumyo
yumyo / SassMeister-input-HTML.html
Created October 15, 2015 12:56
Generated by SassMeister.com.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>General Asymmetric Grid</h1>
<div id="asymmetric-general">&nbsp;</div>
@yumyo
yumyo / clean-walker.php
Created October 27, 2015 15:15 — forked from hereswhatidid/clean-walker.php
WordPress nav walker that strips the WP generated styles and IDs from the generated output.
<?php
class Clean_Walker_Nav extends Walker_Nav_Menu {
/**
* Filter used to remove built in WordPress-generated classes
* @param mixed $var The array item to verify
* @return boolean Whether or not the item matches the filter
*/
function filter_builtin_classes( $var ) {
return ( FALSE === strpos( $var, 'item' ) ) ? $var : '';
}
/**
* Place this code in your theme's functions.php file to make the HTML
* it produces is more BEM friendly.
* This works out the menu_class value from wp_nav_menu() and uses that to create
* the class values.
*/
// Add a class to wp_nav_menu <li> tags so you get <li class="{menu_class}_item">
add_filter('nav_menu_css_class' , 'my_nav_special_class' , 10 , 3);
function my_nav_special_class($classes, $item, $args){