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
window.Lodr = fidel.define('lodr', { | |
defaults : { | |
backgroundString : 'url(\'__\')', | |
callback : [], | |
height : window.innerHeight || document.documentElement.clientHeight, | |
srcsetTimeout : 60, | |
retina : !!window.hasOwnProperty('devicePixelRatio') && window.devicePixelRatio >= 2, | |
responsive : { | |
small : 480, | |
medium : 768, |
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
require 'digest/md5' | |
h = {} | |
Dir.glob("**/*", File::FNM_DOTMATCH).each do |f| | |
next if File.directory?(f) | |
k = Digest::MD5.hexdigest(IO.read(f)).to_sym | |
if h.has_key? k | |
h[k].push f |
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 Leaflet = Fidel.declare({ | |
defaults : { | |
imperial : 1609.344, | |
locations : [], | |
map : null, | |
markers : [], | |
options : {}, | |
pin : { | |
size : { | |
w : 48, |
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 | |
$url = $_REQUEST['image']; | |
$max_width = 500; | |
$max_height = 500; | |
$ch = curl_init(); | |
curl_setopt($ch,CURLOPT_URL,$url); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); |
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
$cols = array(); | |
$date = new DateTime(date('Y-m-d', strtotime('-1 week'))); | |
for ($i = 0; $i < 7; $i++) { | |
$cols[$date->format('l')] = array( | |
'label' => $date->format('Y-m-d') | |
); | |
$date->modify('+1 day'); |
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
x = setInterval(function(){ | |
--w >= 0 ? console.log([w / 86400, (w / 3600) % 24, (w / 60) % 60, w % 60].map(function(n){ | |
return n < 10 ? '0' + ~~n : ~~n | |
}).join(':')) : clearInterval(x); | |
}, [1e3, w = 10][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
namespace :assets do | |
desc 'Precompile assets and upload to S3' | |
task :sync => :environment do | |
assets = build_asset_dir | |
raise 'asset directory is empty: aborting' unless assets.size > 1 | |
invalid_files = build_assets assets | |
delete_old_assets assets | |
invalidate_files invalid_files unless invalid_files.empty? |
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
Kohana::modules(array( | |
// 'auth' => MODPATH.'auth', // Basic authentication | |
// 'cache' => MODPATH.'cache', // Caching with multiple backends | |
// 'codebench' => MODPATH.'codebench', // Benchmarking tool | |
// 'database' => MODPATH.'database', // Database access | |
// 'image' => MODPATH.'image', // Image manipulation | |
// 'orm' => MODPATH.'orm', // Object Relationship Mapping | |
// 'unittest' => MODPATH.'unittest', // Unit testing | |
// 'userguide' => MODPATH.'userguide', // User guide and API documentation | |
'ui' => MODPATH.'ui', // Load custom UI module |
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 defined('SYSPATH') or die('No direct access allowed.'); | |
/* | |
* Author : Mike Dyer | |
* @Anchor.php | |
* | |
* @params : | |
* uri : anchor location | |
* title : anchor text | |
* attrs : valid anchor attributes | |
* |
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.prototype.remove = function(member) { | |
var index = this.indexOf(member); | |
index > -1 && this.splice(index, 1); | |
} | |
return this; | |
} | |
['one', 'two', 'three'].remove('two'); | |
['four', 'five', 'six'].remove('three'); |