Moved ... https://github.com/ryanburnette/fragment-cache
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 | |
/* | |
Usage: | |
cache_fragment_output( 'unique-key', 3600, function () { | |
functions_that_do_stuff_live(); | |
these_should_echo(); | |
}); | |
*/ | |
function cache_fragment_output( $key, $ttl, $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
#!/usr/bin/env perl | |
# | |
# htpasswd.pl | |
# | |
# Copyright (c) 2013, Gelu Lupas <[email protected]> | |
# | |
# Permission to use, copy, modify, and/or distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. | |
# |
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
## | |
# Better Errors plugin on Padrino | |
# | |
# https://github.com/charliesome/better_errors | |
# | |
GEMFILE = <<-GEMFILE | |
# Better Errors | |
group :development do |
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
// global colour variables: | |
@blue = #3CF; | |
@red = #DF1F45 | |
#content { | |
background: #eee; | |
padding: 25px; | |
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 'bundler/capistrano' | |
set :application, "net" | |
set :repository, "[email protected]:net.git" | |
set :scm, :git | |
set :default_environment, { | |
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" | |
} |
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
add_filter("mce_external_plugins", "tomjn_mce_external_plugins"); | |
function tomjn_mce_external_plugins($plugin_array){ | |
$plugin_array['typekit'] = get_template_directory_uri().'/typekit.tinymce.js'; | |
return $plugin_array; | |
} |
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 'bitly' | |
module Jekyll | |
class BitlyFilterCache | |
def initialize | |
@result_cache = {} | |
config = Jekyll.configuration({}) | |
@username = config['bitly']['username'] | |
@key = config['bitly']['api_key'] | |
Bitly.use_api_version_3 |
I'm trying to make a horizontal rainbow stripe background gradient mixin, but I feel like this is way too verbose. How can it be better?
Goals:
- [check] Use variables for colors so they can be swapped out for different colors.
- [check] The widths are hard coded for 8 colors. Can it be done smarter where it adjusts to the number of colors you add? Or is that asking too much?
- [check] The colors are defined twice for the color starts and stops. Can this be done better?
- [see below] Right now I define the colors as variables at the top level, then pass them in the mixin. Should they instead be created inside the mixin and then colors are brought in as arguments? Or does that matter?