Skip to content

Instantly share code, notes, and snippets.

@smhmic
smhmic / hover-fix.js
Created March 24, 2014 16:58
disable :hover on touch devices to avoid sticky hover state (http://retrogamecrunch.com/tmp/hover-fix)
// disable :hover on touch devices
// based on https://gist.github.com/4404503
// via https://twitter.com/javan/status/284873379062890496
// + https://twitter.com/pennig/status/285790598642946048
// re http://retrogamecrunch.com/tmp/hover
if ('createTouch' in document)
{
try
{
var ignore = /:hover/;
@smhmic
smhmic / confirm.sh
Last active August 29, 2015 13:57
bash shell yes/no confirmation prompt
function confirm() {
[ 1 != "`is_interactive`" ] && \
return 1
local prompt="$1"
local choices="y/n"
[ $# = 0 ] && \
prompt="Do you want to proceed?"
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
source /bath/to/bash-getopt
foo_dflt="wibble"
bash-getopt "$@" <<END_OPTS
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
@smhmic
smhmic / xdebug-styles.css
Created August 25, 2014 14:29
improved xdebug styling (for stack traces, etc)
.xdebug-error {
white-space: pre-wrap;
}
.xdebug-error > tr:first-child > td:first-child,
.xdebug-error > tbody > tr:first-child > td:first-child {
padding: 1em;
@smhmic
smhmic / events-conditional-wrappers.php
Last active November 27, 2017 22:41 — forked from jo-snips/events-conditional-wrappers.php
Modern Tribe's The Events Calendar (WordPress plugin) conditional template tags
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
__author__ = 'schwa'
import os
import subprocess
import glob
from github import Github # pip install PyGithub
from bitbucket.bitbucket import Bitbucket # pip install --user bitbucket-api
GH_USERNAME = '[email protected]'
GH_PASSWORD = '1234'
@smhmic
smhmic / gitignore_global.txt
Last active January 16, 2017 03:51
gitignore global
#
# This file specifies intentionally untracked files to ignore
# http://git-scm.com/docs/gitignore
#
# The purpose of gitignore files is to ensure that certain files not
# tracked by Git remain untracked.
#
# To ignore uncommitted changes in a file that is already tracked:
# `git update-index --assume-unchanged`.
#
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Seon-Wook Park</author>
</meta>
<bindings>
<select itemPath="" produces="XML">
<inputs>
<key id='url' type='xs:string' paramType='variable' required='true' />
@smhmic
smhmic / README.md
Last active August 29, 2015 14:15 — forked from dciccale/README.md

triggerEvent

Cross-browser function to trigger DOM events.