Skip to content

Instantly share code, notes, and snippets.

View ivandotv's full-sized avatar
🏠
Working from home

Ivan Vlatković ivandotv

🏠
Working from home
View GitHub Profile
package org.robotlegs.utilities.remote
{
import com.adobe.serializers.json.JSONDecoder;
import mx.collections.ArrayCollection;
public class JsonRemoteService extends RemoteServiceBase
{
public function JsonRemoteService(rootURL:String = "")
{
@mjangda
mjangda / get_current_post_type.php
Created July 15, 2010 13:55
Get the current post_type context in the WordPress admin.
<?php
/**
* Gets the current global post type if one is set
*/
function x_get_current_post_type() {
global $post, $typenow, $current_screen;
if( $post && $post->post_type )
$post_type = $post->post_type;
elseif( $typenow )
<?php
/*
Plugin Name: Instrument Hooks for WordPress
Description: Instruments Hooks for a Page. Outputs during the Shutdown Hook.
Version: 0.1
Author: Mike Schinkel
Author URI: http://mikeschinkel.com
*/
if (isset($_GET['instrument']) && $_GET['instrument']=='hooks') {
@paulirish
paulirish / gist:526168
Created August 16, 2010 00:42 — forked from anonymous/>
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- According to Heather Champ, former community manager at flickr,
you should not allow search engines to index your "Contact Us"
@jackfuchs
jackfuchs / jquery.support.cssproperty.js
Last active January 13, 2024 16:07
Extends the jQuery.support object to CSS Properties
/**
* jQuery.support.cssProperty
* To verify that a CSS property is supported
* (or any of its browser-specific implementations)
*
* @param p css property name
* @param rp optional, if set to true, the css property name will be returned
* instead of a boolean support indicator
* @return {mixed}
*
@mjangda
mjangda / ajaxurl.php
Created August 18, 2011 22:15
Get a domain-mapping safe admin-ajax URL on WordPress.com
<?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
@mattboon
mattboon / gist:1275191
Created October 10, 2011 12:32
WordPress - Query Custom Post Type and taxonomy term by ID
<?php
// gets the ID from a custom field to show posts on a specific page
$buildType = get_post_meta($post->ID, 'build_type_id', true);
// run query
query_posts(array(
'post_type' => 'portfolio',
'showposts' => -1,
'tax_query' => array(
array(
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created March 6, 2012 01:05
How to fork a github repository in bitbucket

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
@jgarber
jgarber / MIT-LICENSE.txt
Created April 4, 2012 14:57
Responsive video
Copyright (c) 2011 ZURB, http://www.zurb.com/