Skip to content

Instantly share code, notes, and snippets.

@colllin
colllin / _affixWithinContainer.md
Last active November 29, 2020 17:13
ion-list sticky headers

What this does:

Within an <ion-scroll>, this directive creates sticky item headers that get bumped out of the way by the next item.

Demo: http://cl.ly/2u2X390s0H1a

Requirements:

  • Needs UnderscoreJS for its _.throttle utility.
  • Must be used within an or
@grappler
grappler / Gruntfile.js
Last active October 5, 2020 03:47
https://webtranslateit.com/en/docs/web_translate_it_client/ / http://docs.transifex.com/developer/client/ Run this command in the folder to install all of the files needed. `npm install --save-dev`
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
makepot: {
target: {
<?php
/*
* Plugin Name: Oh noes, not another SEO plugin!
* License: GPLv3 http://www.gnu.org/copyleft/gpl.html
*/
add_filter( 'wp_title', function( $title ) {
if ( is_singular() ) $title .= ' &mdash; ' . get_bloginfo( 'name' );
if ( is_archive() ) $title = sprintf( ' Archives: %s &mdash; %s', $title, get_bloginfo( 'name' ) );
if ( is_home() ) $title = sprintf( '%s &mdash; %s', get_bloginfo( 'name' ), get_bloginfo( 'description' ) );
if ( is_search() ) $title = sprintf( 'Searching for: %s &mdash; %s', get_search_query( true ), get_bloginfo( 'description' ) );
@helen
helen / wp-chosen-tax-metabox.php
Last active April 24, 2022 02:25
Use Chosen for a replacement WordPress taxonomy metabox
<?php
/**
* WordPress Chosen Taxonomy Metabox
* Author: Helen Hou-Sandi
*
* Use Chosen for a replacement taxonomy metabox in WordPress
* Useful for taxonomies that aren't changed much on the fly and are
* non-hierarchical in nature, as Chosen is for flat selection only.
* You can always use the taxonomy admin screen to add/edit taxonomy terms.
* Categories need slightly different treatment from the rest in order to
@necolas
necolas / snippet.js
Created June 14, 2011 20:36
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],