NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
" | |
" While editing a Markdown document in Vim, preview it in the | |
" default browser. | |
" | |
" Author: Nate Silva | |
" | |
" To install: Place markdown.vim in ~/.vim/ftplugin or | |
" %USERPROFILE%\vimfiles\ftplugin. | |
" | |
" To use: While editing a Markdown file, press ',p' (comma p) |
<!doctype html> | |
<!-- | |
WARNING! | |
You probably shouldn't use this technique since images never show up | |
if the script isn't loaded for one reason or another. Some reasons: | |
- The content is viewed using a RSS reader | |
- The content is viewed with a read-it-later service | |
- The user has a flaky connection (hotel wifi, Dutch train, etc) | |
--> |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
<?php | |
$jsonCacheFile = './quickfix.json'; | |
$gimmieFeed = 'https://gimmebar.com/api/v0/public/assets/phpquickfix'; | |
$wgetCmd = 'wget -O'.$jsonCacheFile.' '.$gimmieFeed; | |
// look for the cache file | |
if(!is_file($jsonCacheFile) || (is_file($jsonCacheFile) && filemtime($jsonCacheFile)<strtotime('-1 minute')) ){ | |
// fetch the latest content from gimmiebar | |
exec($wgetCmd); |
--- | |
layout: default | |
--- | |
<div class="blog-index"> | |
{% assign post = site.posts.first %} | |
{% assign content = post.content %} | |
{% include post_detail.html %} | |
</div> |
This quick little middleware grabs all HTML pages going across the wire, peeks inside and replaces the content with some nice features: curly quotes instead of straight quotes (prime marks), conversion of -- to proper emdashes, insertion of to prevent text widows, wrapper HTML classes for caps and ampersands for fancier styling, and other fun things. | |
It's really a middleware wrapper for Typogruby (http://avdgaag.github.com/typogruby/), so check it out if you want the gory details. | |
It requires: | |
typogruby: http://avdgaag.github.com/typogruby/ | |
nokogiri: http://nokogiri.org/ | |
Have fun! |
@media only screen and (min-width: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).