Skip to content

Instantly share code, notes, and snippets.

grunt.initConfig({
// ...other plugins
jshint: {
files: [
'Gruntfile.js',
'cookiejar.js',
'test/*.js'
]
}, // ...other plugins
});
grunt.event.on('watch', function (action, path, target) {
if (target === 'html' || target === 'css' /* and on and on for your target types in watch */) {
grunt.config(['clean', 'any'], []);
// Making an assumption your using sftp and have a current working directory setup
cwd = grunt.config.get(['sftp', 'cwd']) + '/';
path = path.replace(cwd, '');
grunt.config(['sftp', 'options', 'path'], path);
}
});
@chaseadamsio
chaseadamsio / anchor-image-code.html
Last active September 28, 2021 09:43
A code example of how to nest an image in an anchor link with Markdown.
<!-- The link we want our bower bird to point to -->
[1]: http://www.bower.io
<!-- The image url we want to use for our img tag source -->
[2]: http://bower.io/img/bower-logo.png
<!--
This will compile to two html nodes:
Anchor: [linked item][1]: <a href="1">linked item</a>
Image: ![alt text][2]: <img src="2" alt="alt text" />
@chaseadamsio
chaseadamsio / post-receive.sh
Last active July 6, 2016 18:23
The post-receive hook that I use for deploying my Wordpress theme on a `git push`.
#!/bin/sh
LOGFILE=./post-receive.log
DEPLOYDIR=$DEPLOYDIR # The place to deploy to.
echo -e "[log] Received push request at $( date +%F)" >> $LOGFILE
echo "[log] - Old SHA: $oldrev New SHA: $newrev Branch Name: $refname" >> $LOGFILE
echo "[log] Starting Deploy..." >> $LOGFILE
/*jshint multistr:true */
var text = "Lorem ipsum Kat sit amet, KrisKris adipiscing elit. Vestibulum Kite consectetur lorem, KKris aliquam turpis Kilts nec. Nam vel mattis."
var myName = "Kris";
var hits = [];
var count = 0;
console.log("**********************");
for (var i=0; i<= text.length; i++)
{
if(text[i]=="K")
self.bold = function(state) {
self.printer.write(esc);
self.printer.write(chr(69));
// 0 || 'off' = off
// 1 || 'on' = on
self.printer.write(chr(state));
}
@chaseadamsio
chaseadamsio / handlebars-debugger.js
Created February 10, 2014 22:50
A snippets helper for debugging handlebars. Appends debug to all templates so you don't have to type it in yourself, and when a template is rendered, the context is logged in the console.
var scriptsNodeList = document.getElementsByTagName('script'),
debugSet = false,
templates, scripts;
// convert node list to array
scripts = Array.prototype.slice.call(scriptsNodeList);
templates = scripts.filter(function(script) {
return script.type === 'text/x-handlebars-template';
{
"color_scheme": "Packages/github-sublime-theme/GitHub.tmTheme",
"extensions":
[
"md",
"mdwn",
"mmd",
"txt",
"markdown"
],
@chaseadamsio
chaseadamsio / codeschool-challenge.md
Last active August 29, 2015 13:57
What would your code to complete the following challenge look like?

Write some code that prints the following to the browser console, using just ONE string and the existing variables to produce the correct format:

"Old Faithful" at Yellowstone National Park\n Average eruption height today: 145\n Number of eruptions: 4\n

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.098313517868518829</real>
<key>Green Component</key>
<real>0.11400297284126282</real>