This file contains hidden or 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
updateVersionDropdown : function() { | |
var versionsByLang = {}; | |
// Loop through the version model | |
_.each( | |
// Group versions by language, | |
// and sort the lang keys alphabetically. | |
_.groupBy(_.sortBy(this._versions.models, function (ver) { | |
return ver.get('lang'); | |
}), function (ver) { |
This file contains hidden or 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
var languages = _.groupBy(_.sortBy(this._versions, function (v) { | |
return v.get('lang'); | |
}), function (v) { | |
return v.get('lang'); | |
}); | |
console.log(languages); |
This file contains hidden or 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
updateVersionDropdown : function() { | |
var languages = {}, | |
sortedLangs = {}; | |
this._versions.each(function(ver){ | |
var lang = ver.get('lang'); | |
if (!languages[lang]) { | |
languages[lang] = []; | |
} | |
languages[lang].push(ver); |
This file contains hidden or 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
Array | |
( | |
[76899] => Array | |
( | |
[level] => 0 | |
[comment_id] => 4735 | |
[disqus_id] => 76899 | |
[disqus_parent_id] => 0 | |
[root_id] => 0 | |
[parent_id] => 0 |
This file contains hidden or 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
// exp_rating_stats | |
ALTER TABLE `exp_rating_stats` CHANGE `weblog_id` `channel_id` int(4) unsigned NOT NULL DEFAULT '0', CHANGE `form_name` `collection` varchar(50) NOT NULL, CHANGE `rating_date` `last_rating_date` int(10) unsigned NOT NULL DEFAULT '0', ADD COLUMN `member_id` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `channel_id`, ADD KEY (`member_id`); | |
// exp_ratings | |
ALTER TABLE `exp_ratings` CHANGE `weblog_id` `channel_id` int(4) unsigned NOT NULL DEFAULT '0', CHANGE `form_name` `collection` varchar(50) NOT NULL, CHANGE `rating_rev_r_y` `rating_helpful_y` int(10) NOT NULL DEFAULT '0', CHANGE `rating_rev_r_n` `rating_helpful_n` int(10) NOT NULL DEFAULT '0', DROP COLUMN `entry_title`, ADD KEY (`channel_id`), ADD KEY (`collection`), DROP KEY form_name; | |
// populate member_id |
This file contains hidden or 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
CREATE TABLE IF NOT EXISTS `exp_rating_stats` ( | |
`stat_id` int(10) unsigned NOT NULL AUTO_INCREMENT, | |
`entry_id` int(10) unsigned NOT NULL DEFAULT '0', | |
`channel_id` int(4) unsigned NOT NULL DEFAULT '0', | |
`member_id` INT UNSIGNED NOT NULL DEFAULT 0, | |
`collection` varchar(50) NOT NULL, | |
`last_rating_date` int(10) unsigned NOT NULL DEFAULT '0', | |
`count` int(10) unsigned NOT NULL DEFAULT '0', | |
`sum` int(10) unsigned NOT NULL DEFAULT '0', | |
`avg` float unsigned NOT NULL DEFAULT '0', |
This file contains hidden or 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
#!/bin/bash | |
# Author: Marissa Hogue <[email protected]> | |
# Last updated: 11/15/2011 | |
# Pipes various 'svn diff' output to vim | |
show_usage() { | |
echo "Usage: svnd <revision> <file>" | |
echo | |
echo "Examples:" | |
echo " svnd # get diff for working copy" |
This file contains hidden or 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
// Option A: reset maximum-scale on blur | |
var viewportMeta = $('meta[name="viewport"]'); | |
$('select[name="filter"]').bind('focus blur', function(event) { | |
viewportMeta.attr('content', 'width=device-width,initial-scale=1,maximum-scale=' + (event.type == 'blur' ? 10 : 1)); | |
}); | |
// Option B: limit maximum-scale to 1 | |
var viewportMeta = $('meta[name="viewport"]'); |
This file contains hidden or 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
// Option A: reset maximum-scale on blur | |
var viewportMeta = $('meta[name="viewport"]'); | |
$('select[name="filter"]').bind('focus blur', function(event) { | |
viewportMeta.attr('content', 'width=device-width,initial-scale=1,maximum-scale=' + (event.type == 'blur' ? 10 : 1)); | |
}); | |
// Option B: limit maximum-scale to 1 | |
var viewportMeta = $('meta[name="viewport"]'); |
This file contains hidden or 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 | |
function i18nPOStrings() { | |
$locale = str_replace('-', '_', get_instance()->config->item('language_ui')->locale); | |
//$default = str_replace('-', '_', get_instance()->config->item('language_ui_default')->locale); | |
$dir = APPPATH . 'language/locale/' . $locale . '/LC_MESSAGES/'; | |
$files = glob($dir . '*.po'); | |
foreach ($files as $file) { | |
$contents .= file_get_contents($file) or die('Could not read from file.'); |