Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
// http://aboutcode.net/2010/11/11/list-github-projects-using-javascript.html | |
jQuery.githubUser = function(username, callback) { | |
jQuery.getJSON("http://github.com/api/v1/json/" + username + "?callback=?", callback); | |
} | |
jQuery.fn.loadRepositores = function(username) { | |
this.html("<span>Querying GitHub for repositories...</span>"); | |
var target = this; |
<?php | |
/** | |
* Block deletion of certain categories by their ID. | |
* | |
* Copyright (C) 2010 hakre <http://hakre.wordpress.com/> | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU Affero General Public License as | |
* published by the Free Software Foundation, either version 3 of the | |
* License, or (at your option) any later version. |
<?php | |
// Acme/DemoBundle/Twig/Extension/DateTimeTimeZone.php | |
namespace Acme\DemoBundle\Twig\Extension; | |
use Symfony\Component\Security\Core\SecurityContext; | |
use Acme\DemoBundle\Document\User as User; | |
class DateTimeTimeZone extends \Twig_Extension |
<?php | |
class DemoSubject implements SplSubject{ | |
private $observer, $value; | |
public function __construct(){ | |
$this->observers = array(); | |
} | |
<?php | |
function my_is_valid_domain( $url ) { | |
$whitelisted_domains = array( 'mydomain.com', 'mydomain.net' ); | |
$domain = parse_url( $url, PHP_URL_HOST ); | |
// Check if we match the domain exactly | |
if ( in_array( $domain, $whitelisted_domains ) ) | |
return true; | |
$valid = false; |
<?php | |
/** | |
* Given a string containing any combination of YouTube and Vimeo video URLs in | |
* a variety of formats (iframe, shortened, etc), each separated by a line break, | |
* parse the video string and determine it's valid embeddable URL for usage in | |
* popular JavaScript lightbox plugins. | |
* | |
* In addition, this handler grabs both the maximize size and thumbnail versions | |
* of video images for your general consumption. In the case of Vimeo, you must | |
* have the ability to make remote calls using file_get_contents(), which may be |
function hide_gallery_settings() | |
{ | |
echo '<style type="text/css">#gallery-settings{display:none;}</style>'; | |
} | |
<?php | |
function getStringpart($string,$startStr,$endStr) | |
{ | |
$startpos=strpos($string,$startStr); | |
$endpos=strpos($string,$endStr,$startpos); | |
$endpos=$endpos-$startpos; | |
$string=substr($string,$startpos,$endpos); | |
return $string; |
<?php | |
add_action( 'add_meta_boxes', 'NAME_remove_meta_boxes', 100); | |
function NAME_remove_meta_boxes() { | |
remove_meta_box( 'trackbacksdiv', 'post', 'normal' ); // Trackbacks meta box | |
remove_meta_box( 'postcustom', 'post', 'normal' ); // Custom fields meta box | |
remove_meta_box( 'commentsdiv', 'post', 'normal' ); // Comments meta box | |
remove_meta_box( 'slugdiv', 'post', 'normal' ); // Slug meta box | |
remove_meta_box( 'authordiv', 'post', 'normal' ); // Author meta box | |
remove_meta_box( 'revisionsdiv', 'post', 'normal' ); // Revisions meta box | |
remove_meta_box( 'formatdiv', 'post', 'normal' ); // Post format meta box |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors