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
// instantiate like | |
// var images = new imagePreloader('/path/to/image1.jpg', '/path/to/image2.jpg', ...); | |
var imagePreloader = function() { | |
var _this = this; | |
_this.cache = {}; | |
_this.load = function(src, callback) { | |
var cacheImage = document.createElement('img'); | |
cacheImage.src = src; |
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
git_prompt() { | |
unset __CURRENT_GIT_BRANCH | |
unset __CURRENT_GIT_BRANCH_STATUS | |
unset __CURRENT_GIT_BRANCH_IS_DIRTY | |
local st="$(git status 2>/dev/null)" | |
if [[ -n "$st" ]]; then | |
local -a arr | |
arr=(${(f)st}) |
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 objectsIntoArray($arrObjData, $arrSkipIndices = array()) { | |
$arrData = array(); | |
if (is_object($arrObjData)) { | |
$arrObjData = get_object_vars($arrObjData); | |
} | |
if (is_array($arrObjData)) { |
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
$.fn.selectReplace = function() { | |
if (!($.browser.msie && $.browser.version < 7)) { | |
return this.each(function() { | |
var $this = $(this); | |
$this.wrap('<span id="' + $this.attr('id') + '_wrapper" class="select_wrapper"></span>') | |
.before('<span>' + $this.find('option[value=' + $this.val() + ']').html() + '</span>') | |
.css("opacity", 0) | |
.change(function() { | |
$this.parent().find('span').html($this.find('option[value=' + $this.val() + ']').html()); |
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
CPB.module = function() {}; | |
CPB.module.prototype.constructor = CPB.module; | |
CPB.module.prototype.reload = function(event, data) { | |
var module = this; | |
module.lastUpdate = CPB.timestamp(); | |
module.path = data.path; | |
CPB.dispatcher.process(data.path, function(data) { | |
module.render(module.view.reload, data[module.shortName]); | |
}); | |
module.lastUpdate = CPB.timestamp(); |
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
div.page { | |
background: -webkit-gradient(linear, left bottom, left top, color-stop(0.56, rgba(0,0,0,1)), color-stop(0.12, rgba(0,0,0,0.85))); | |
height: 1008px; | |
padding-top: 16px; | |
position: relative; | |
width: 768px; | |
} | |
#header { | |
background: -webkit-gradient( |
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
// jquery select replace | |
$.fn.selectReplace = function(options) { | |
if (!($.browser.msie && $.browser.version < 7)) { | |
var opts = $.extend({}, $.fn.selectReplace.defaults, options); | |
return this.each(function() { | |
var $this = $(this); | |
var o = $.meta ? $.extend({}, opts, $this.data()) : opts; | |
$this.change(function() { |
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 carousel = function(scope, options) { | |
o = $.extend({}, options, MH.carousel.defaults); | |
var carousel = this, | |
$scope = $(scope), | |
$pages = $(o.pages, scope), | |
$prev = $(o.prev, scope), | |
$next = $(o.next, scope); | |
$current = $pages.eq(0); | |
$current.siblings().css('left', '9999px'); |
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
MH.carousel = function(scope, options) { | |
o = $.extend({}, options, MH.carousel.defaults); | |
var carousel = this, | |
$scope = $(scope), | |
$pages = $(o.pages, scope), | |
$prev = $(o.prev, scope), | |
$next = $(o.next, scope); | |
$current = $pages.eq(0); | |
$current.siblings().css('left', '9999px'); |
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/sh | |
#################################### | |
# Output file for HTML5 video # | |
# Requirements: # | |
# - handbrakecli # | |
# - ffmpeg # | |
# - ffmpeg2theora # | |
# # | |
# usage: # |
OlderNewer