Skip to content

Instantly share code, notes, and snippets.

View bookchiq's full-sized avatar

Sarah Lewis bookchiq

View GitHub Profile
/*
A Revised Font Stack
from A Way Back
http://www.awayback.com/revised-font-stack/
*/
/*

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@2shortplanks
2shortplanks / Evernote and OmniFocus integration
Created February 7, 2011 10:32
Evernote and OmniFocus integration
-- Find the note in omnifocus for the current project / folder
-- (or create a new one) and display it.
-- Created by Mark Fowler (mark@twoshortplanks.com)
-- Help from http://veritrope.com/code/search-evernote-for-notes-containing-link-to-selected-omnifocus-item/
-- on getting the name / url for the current omnifocus item
tell front window of application "OmniFocus"
try
@barneycarroll
barneycarroll / jquery.notextSelector.js
Last active January 14, 2024 07:57
`:notext` is an alternative to the `:empty` selector for jQuery. Elements consisting exclusively of an amount of whitespace or HTML comments will be returned.
/*
jQuery's ':empty' selector only returns true if the element contains no text node, or whose text node consists exclusively of zero or more spaces and tabs. This ':notext' selector will return true for elements whose text nodes can also contain line breaks (any whitespace character) and HTML comments.
*/
$.expr[':'].notext = function detectNoText(x){
return x.innerHTML && x.innerHTML.replace(/(<!--.*(?!-->))|\s+/g, '').length === 0
}
@olivierlacan
olivierlacan / launch_sublime_from_terminal.markdown
Created September 5, 2011 15:50
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@chriseppstein
chriseppstein / 0_selector_hacks.scss
Created September 14, 2011 04:27
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}
@r-a-y
r-a-y / shortcode.php
Created February 22, 2012 21:01
Check if a shortcode exists in WordPress
<?php
if ( ! function_exists( 'shortcode_exists' ) ) :
/**
* Check if a shortcode is registered in WordPress.
*
* Examples: shortcode_exists( 'caption' ) - will return true.
* shortcode_exists( 'blah' ) - will return false.
*/
function shortcode_exists( $shortcode = false ) {
global $shortcode_tags;
@sbrajesh
sbrajesh / hide-subscribers.php
Last active May 22, 2024 11:37
Hide Subscriber Users from BuddyPress member Directory
<?php
/**
* Excludes users from BuddyPress Members list.
*
* @param string $qs Query string.
* @param string $object object loop identikfier.
*
* @return string
*/
function bpdev_exclude_users( $qs = false, $object = false ) {
@maxrice
maxrice / us-state-names-abbrevs.php
Created May 23, 2012 18:32
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
@baamenabar
baamenabar / curl_get_or_save_functions.php
Created September 10, 2012 13:59
PHP cURL get or save simple stuff
<?php
/****************************************************************************
PHP CURL functions for getting data or asytnchronously saving it to file.
It is header redirect tolerant. like the 302 http status.
Save data to file with cURL: save_data_to_file_w_curl($url,$pathToFile);
Get data with cURL get_data_w_curl($url);
/**
* MIT License