Skip to content

Instantly share code, notes, and snippets.

View jonschlinkert's full-sized avatar
🤔
Trying to stay in the right branch of the wave function.

Jon Schlinkert jonschlinkert

🤔
Trying to stay in the right branch of the wave function.
View GitHub Profile
@jonschlinkert
jonschlinkert / mustache-variables.mustache
Created December 5, 2012 00:49
mustache variables idea
It would be fun to creat mustache mixins with variables like in LESS:
page-header.mustache
```sass
<div class="page-header">
<h1>@{variable}</h1>
</div>
```
and use it like this
{
"working_dir": "${project_path:${folder}}",
"cmd": ["C:\\Users\\Schlink\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe", "$file"],
"selector": "source.html"
}
@jonschlinkert
jonschlinkert / any-name.json
Created December 8, 2012 23:41
This is an example grunt plugin for compiling templates to jst or html, using consolidate.js as a "template engine normalizer"
{
"en-us": {
"alert": {
"default": {
"modifier": "",
"heading": "Default",
"strong": "Default Alert!",
"message": "Best check yo self, you're not looking too good."
},
"warning": {
@jonschlinkert
jonschlinkert / grunt-reload-test.js
Created December 9, 2012 18:14
testing grunt-reload in the workflow
/*global module:false*/
module.exports = function(grunt) {
'use strict';
// Define bundles for each site
// Externalize to json all paths to src files for compressed bundles
var docsBundle = grunt.file.readJSON('build/bundles/docs.json'),
docsFiles = [];
var appBundle = grunt.file.readJSON('build/bundles/app.json'),
/**
* Task: attach_heads
* Description: Set the heads for all themes declared in themes.json
*/
module.exports = function(grunt) {
'use strict';
var fs = require('fs');
var path = require('path');
@jonschlinkert
jonschlinkert / monokai-markdown.tmTheme
Created December 25, 2012 21:03
Sublime Text 2, Monokai with support for Markdown
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai Soda</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>

npm shorthands and other CLI niceties

The following shorthands are parsed on the command-line:

-v: --version
-h, -?, --help, -H: --usage
-s, --silent: --loglevel silent
-q, --quiet: --loglevel warn
-d: --loglevel info
@jonschlinkert
jonschlinkert / Preview in Chrome.sublime-build
Created January 3, 2013 20:55
Preview in Chrome.sublime-build, build system for Sublime Text 2 to preview current .html file in chrome with ctrl+b
{
"working_dir": "${project_path:${folder}}",
"cmd": ["C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "$file"],
"selector": "source.html"
}
@jonschlinkert
jonschlinkert / .lessrc
Last active December 11, 2015 13:38
testing grunt-contrib-less with external options
{
"compile": false,
"compress": false,
"noIDs": true,
"noJSPrefix": true,
"noOverqualifying": true,
"noUnderscores": true,
"noUniversalSelectors": true,
"zeroUnits": true,
"strictPropertyOrder": true,
@jonschlinkert
jonschlinkert / pre-less.md
Last active December 11, 2015 18:58
How Pre let's you write HTML and CSS at the same time.

//

Compiles to this:

and this...