Skip to content

Instantly share code, notes, and snippets.

@smhmic
smhmic / GTM console (Admin) .js
Last active April 1, 2025 23:22
console commands for GTM admin
gtm = {
'updateAllUserPermissions' : function( val ){
val = val || 2;
// Update user permissions far all Containers in an Account
//https://tagmanager.google.com/#/admin/accounts/00000000/users/create
jQuery( '[data-ng-model="containerPermission.permission"]' ).val( val ).change()
},
// Make Container export preview copyable.
@smhmic
smhmic / - README - spyGoogleAnalytics.md
Last active February 13, 2020 23:06
GTM listener for non-GTM-based GA tracking (hardcoded on-page, plugins, etc) [a.k.a. spy/hijack GA]
@smhmic
smhmic / reset_permissions_on_time_machine.sh
Created March 6, 2015 03:32
Regain direct access to Time Machine backups from old/other computer.
# USAGE: reset_permissions_on_time_machine TIMEMACHINE_HD_NAME OLD_COMPUTER_NAME
function reset_permissions_on_time_machine(){
echo
TIMEMACHINE_HD_NAME="$1"
OLD_COMPUTER_NAME="$2"
if [ -z "$TIMEMACHINE_HD_NAME" ]; then
echo "USAGE: reset_permissions_on_time_machine TIMEMACHINE_HD_NAME OLD_COMPUTER_NAME"
echo "Choose the name of the Time Machine disk:"
@smhmic
smhmic / move_phpstorm_config_to_single_folder.sh
Last active August 29, 2015 14:16
For Mac. Consolidates PhpStorm configuration and plugins into single folder (like on Linux and Windows). Also allows config/plugins to be synced via Dropbox or other cloud service.
#
# DESC:
# Will move ~/Library/Preferences/.WebIdeXX (config)
# and ~/Library/Application Support/.WebIdeXX (plugins)
# to ~/G/G/etc/.phpstormX
# /config
# /plugins
# and updates PhpStorm.app/Contents/bin/idea.properties to point to new location.
#
# REF:
@smhmic
smhmic / functions.php
Last active July 19, 2022 07:17 — forked from un1ko85/new_gist_file.php
wordpress - disable all rss and pingbacks and trackbacks on dev/staging sites
<?php
if( IS_DEV_SITE ) {
//Disable RSS Feeds functions
add_action('do_feed', array( $this, 'disabler_kill_rss' ), 1);
add_action('do_feed_rdf', array( $this, 'disabler_kill_rss' ), 1);
add_action('do_feed_rss', array( $this, 'disabler_kill_rss' ), 1);
add_action('do_feed_rss2', array( $this, 'disabler_kill_rss' ), 1);
add_action('do_feed_atom', array( $this, 'disabler_kill_rss' ), 1);
if(function_exists('disabler_kill_rss')) {
@smhmic
smhmic / css_resources.md
Last active August 29, 2015 14:15 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@smhmic
smhmic / python_resources.md
Last active August 29, 2015 14:15 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@smhmic
smhmic / javascript_resources.md
Last active August 29, 2015 14:15 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@smhmic
smhmic / README.md
Last active August 29, 2015 14:15 — forked from dciccale/README.md

triggerEvent

Cross-browser function to trigger DOM events.

<?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' />