Skip to content

Instantly share code, notes, and snippets.

Jakub Chodorowicz chodorowicz

Block or report user

Report or block chodorowicz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:496504
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// mit license. paul irish. 2010.
// webkit fix from Oren Solomianik. thx!
// callback function is passed the last image to load
// as an argument, and the collection as `this`
View functions.php
<?php
/*
Description: Adds a taxonomy filter in the admin list page for a custom post type.
Written for: http://wordpress.stackexchange.com/posts/582/
By: Mike Schinkel - http://mikeschinkel.com/custom-workpress-plugins
Instructions: Put this code in your theme's functions.php file or inside your own plugin. Edit to suite your post types and taxonomies. Hope this helps...
*/
//
add_filter('manage_{custom_post_type_name}_posts_columns', 'add_custom_taxonomy_column');
@chodorowicz
chodorowicz / do_slugify_filename.js
Created Nov 17, 2011
Directory Opus JScript slugify/web-safe rename
View do_slugify_filename.js
@script jscript
function Rename::GetNewName2 ( strFileName, strFilePath, _fIsFolder, strOldName, strNewName ){
r = strFileName;
r = r.toLowerCase();
r = r.replace(new RegExp("[àáâãäåą]", 'g'),"a");
r = r.replace(new RegExp("[æ]", 'g'),"ae");
r = r.replace(new RegExp("[çčçć]", 'g'),"c");
r = r.replace(new RegExp("[èéěêëę]", 'g'),"e");
@chodorowicz
chodorowicz / image-shortcode.php
Created Jun 13, 2012 — forked from kovshenin/image-shortcode.php
Image shortcode for WordPress
View image-shortcode.php
<?php
/**
* Image shortcode callback
*
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files
* from existing media library entries. Usage:
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100" style="margin-top:10px" title="image title"]
*
* @uses image_make_intermediate_size
*/
View dabblet.css
.wrapper:hover label{
background-position:left bottom;
}
label{
background:url('http://img833.imageshack.us/img833/5959/stard.png') no-repeat left bottom;
float:right;
line-height:20px;
padding-left:20px;
height:15px;
}
@chodorowicz
chodorowicz / index.html
Created Mar 22, 2013
A CodePen by Jakub Chodorowicz.
View index.html
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Wing Chun Terms</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
@chodorowicz
chodorowicz / index.html
Created Mar 24, 2013
A CodePen by monolithpl.
View index.html
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Wing Chun Terms</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
@chodorowicz
chodorowicz / index.html
Created Mar 24, 2013
A CodePen by monolithpl.
View index.html
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Wing Chun Terms</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
View dabblet.css
.slider {
/* set initial width */
width: 520px;
/* hide the content that overflows (to allow second box to show through) */
overflow: hidden;
display: inline-block;
/* skew container so that it has angled edge, and set up transition */
transform: skewX(-20deg);
@chodorowicz
chodorowicz / get_translated_media_or_original.php
Last active Mar 30, 2017
get file media file in current language, if it doesn't exist get original version
View get_translated_media_or_original.php
<?php
if (!function_exists('get_translated_media_or_original')) {
function get_translated_media_or_original($media_file_id) {
global $wpdb;
// check language of media file
$custom_query = "SELECT * FROM ".$wpdb->postmeta." WHERE meta_key='wpml_media_lang' AND post_id=".$wpdb->escape($media_file_id);
$meta = $wpdb->get_results( $custom_query );
$media_file_language = $meta[0]->meta_value;
// if language of media file equals current language, return that id
if($media_file_language == ICL_LANGUAGE_CODE) {
You can’t perform that action at this time.