- Mac OS X 10.8.4+
- Install the latest version of Xcode 5 (currently 5.0.2) from Downloads for Apple Developers or,
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| #!/bin/bash | |
| # works with a file called VERSION in the current directory, | |
| # the contents of which should be a semantic version number | |
| # such as "1.2.3" | |
| # this script will display the current version, automatically | |
| # suggest a "minor" version update, and ask for input to use | |
| # the suggestion, or a newly entered value. |
| #!/bin/bash | |
| # Functions ============================================== | |
| # return 1 if global command line program installed, else 0 | |
| # example | |
| # echo "node: $(program_is_installed node)" | |
| program_is_installed () { | |
| # set to 1 initially | |
| local return_=1 |
| #!/bin/sh | |
| libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i32.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i64.2.dylib" \ | |
| "/usr/local/lib/libmacfuse_i64.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i32.la" \ | |
| "/usr/local/lib/libosxfuse_i64.la" \ | |
| "/usr/local/lib/pkgconfig/osxfuse.pc" ) |
| <?php | |
| /** | |
| * Generates a domain-mapping safe URL on WordPress.com | |
| * Core's ajaxurl uses admin_url() which returns *.wordpress.com which doesn't work for the front-end on domain-mapped sites. | |
| * This works around that and generates the correct URL based on context. | |
| */ | |
| function my_admin_ajax_url( $path = '' ) { | |
| if ( is_admin() ) | |
| $url = admin_url( 'admin-ajax.php' ); | |
| else |
| <?php | |
| /* | |
| Plugin Name: Esemci: SMC (Main Site): Types and Taxonomies | |
| Plugin URI: https://gist.github.com/montchr/b5806349e64f48b808b6 | |
| Description: Defines custom taxonomies and custom post types for the main SMC site (https://smc.temple.edu/). | |
| Version: 0.1.0 | |
| Author: Chris Montgomery | |
| Author URI: https://github.com/montchr | |
| License: GPLv3 | |
| */ |
| <?php | |
| /** | |
| * Check to see if the supplied array is associative. | |
| * | |
| * @link http://stackoverflow.com/questions/173400/how-to-check-if-php-array-is-associative-or-sequential | |
| * @return bool True if is associative, false if non-associative. | |
| */ | |
| function is_assoc($array) { | |
| return (bool)count(array_filter(array_keys($array), 'is_string')); |