This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (global, $) { | |
global.namespace = function (nsName, obj) { | |
var level, names, name; | |
level = global; | |
names = nsName.split('.'); | |
while(name = names.shift()) { | |
level[name] = level[name] || {}; | |
level = level[name]; | |
} | |
$.extend(level, obj); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* The JW Player plugin drops shortcode into the editor. It's not filtered through WordPress's do_shortcode(). | |
* You need to use jwplayer_tag_callback(). | |
*/ | |
global $post; | |
if (get_post_meta($post->ID, '_cmb_mini_wysiwyg', true) ): | |
$myvid = get_post_meta($post->ID, '_cmb_mini_wysiwyg', true); | |
$myvid = jwplayer_tag_callback( $myvid ); | |
echo $myvid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: sans-serif; | |
} | |
ul { | |
list-style: none | |
} | |
a{ | |
text-decoration: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Used when you need a JSON feed from your other domain. Need a | |
Content-type of application/json, so be sure to use the correct | |
HTTP header in your app (at the other domain). | |
*/ | |
// blabla just don't forget jQuery | |
$.ajax({ | |
url: "another domain generating a JSON", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"nodes":[{"name":"Myriel","group":1},{"name":"Napoleon","group":1},{"name":"Mlle.Baptistine","group":1},{"name":"Mme.Magloire","group":1},{"name":"CountessdeLo","group":1},{"name":"Geborand","group":1},{"name":"Champtercier","group":1},{"name":"Cravatte","group":1},{"name":"Count","group":1},{"name":"OldMan","group":1},{"name":"Labarre","group":2},{"name":"Valjean","group":2},{"name":"Marguerite","group":3},{"name":"Mme.deR","group":2},{"name":"Isabeau","group":2},{"name":"Gervais","group":2},{"name":"Tholomyes","group":3},{"name":"Listolier","group":3},{"name":"Fameuil","group":3},{"name":"Blacheville","group":3},{"name":"Favourite","group":3},{"name":"Dahlia","group":3},{"name":"Zephine","group":3},{"name":"Fantine","group":3},{"name":"Mme.Thenardier","group":4},{"name":"Thenardier","group":4},{"name":"Cosette","group":5},{"name":"Javert","group":4},{"name":"Fauchelevent","group":0},{"name":"Bamatabois","group":2},{"name":"Perpetue","group":3},{"name":"Simplice","group":2},{"name":"Scaufflaire","group":2}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT *, count(client_tests.id) AS test_count FROM clients LEFT JOIN client_tests ON clients.id = client_tests.client_id GROUP BY clients.id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Helpful link: http://httpd.apache.org/docs/2.4/logs.html | |
require 'date' | |
line_count = 0 | |
File.open(ARGV[0]).readlines.each do |line| | |
line_count += 1 | |
result = /^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}).*\[(.*)\].*(GET|HEAD|POST|PUT|DELETE|TRACE|CONNECT)\s(.*)\"\s(\d+)\s(\d+)(.*)$/.match(line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add to functions.php or place in mu-plugins | |
// Admin Notice on Posts Page | |
add_action('admin_head-post.php', 'us2011_postspage_error_notice'); | |
function us2011_postspage_error_notice() { | |
$postspage = get_option('page_for_posts'); | |
if (!empty($postspage)) | |
add_action('admin_notices', 'us2011_postspage_print_notices'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use LWP::Simple; | |
use strict; | |
use warnings; | |
my $content = get("feed://www.google.com/trends/hottrends/atom/hourly"); | |
die "Could not retrieve feed" unless defined ($content); |
OlderNewer