NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
<?php | |
/** | |
* Implements hook_html_head_alter(). | |
* - Simplify the meta charset element. | |
*/ | |
function THEMENAME_html_head_alter(&$head_elements) { | |
$head_elements['system_meta_content_type']['#attributes'] = array( | |
'charset' => 'utf-8', | |
); |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
/** | |
* Polyfill for the vw, vh, vm units | |
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/ | |
* @author Lea Verou | |
*/ | |
(function() { | |
if(!window.StyleFix) { | |
return; |
<?php | |
/** | |
* Implements hook_library(). | |
*/ | |
function MYMODULE_library() { | |
// jQuery UI from Google. | |
$libraries['ui'] = array( | |
'title' => 'jQuery UI: All', | |
'website' => 'http://jqueryui.com', |
# Filename-based cache busting | |
# taken from https://github.com/h5bp/html5-boilerplate/ | |
# This rewrites file names of the form `name.123456.js` to `name.js` | |
# so that the browser doesn't use the cached version when you have | |
# updated (but not manually renamed) the file. | |
<IfModule mod_rewrite.c> | |
Options +FollowSymlinks | |
RewriteEngine On |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
Sass and Compass Resources | |
===================================================== | |
***ONLINE*** | |
> Official: http://sass-lang.com | |
> Official: http://compass-style.org | |
> http://thesassway.com |
guard 'process', :name => 'shrink-images', :command => 'ruby resize-mobile-images.rb mobileretina' do | |
watch /^images\/mobileretina\/.+/ | |
end |
@mixin mobile_bg($file){ | |
background-image: image-url('mobile/standard/#{$file}'); | |
@media screen and (-webkit-min-device-pixel-ratio: 2) { | |
background-image: image-url('mobile/retina/#{$file}'); | |
background-size: image-width('mobile/standard/#{$file}') image-height('mobile/standard/#{$file}'); | |
} | |
} | |
// Usage |