Skip to content

Instantly share code, notes, and snippets.

<?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>author</key>
<string>Jacob Rus</string>
<key>comment</key>
<string>Created by Jacob Rus. Based on ‘Slate’ by Wilson Miner</string>
<key>name</key>
<string>Cowboy - Presentation</string>
<?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>name</key>
<string>Solarized (dark)</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
/*****************************************************************************
* __ __ _ _ ___ _
* \ \/ _\ /\/\ (_)_ __ | |_ _ _ / __\ __ ___ ___| |__
* \ \ \ / \| | '_ \| __| | | | / _\| '__/ _ \/ __| '_ \
* /\_/ /\ \ / /\/\ \ | | | | |_| |_| | / / | | | __/\__ \ | | |
* \___/\__/ \/ \/_|_| |_|\__|\__, | \/ |_| \___||___/_| |_|
* |___/
*
* Identifying and Eliminating Code Smells
*
// repetitive code!
function updateDates() {
var startDate = $("#start-date").datepicker("getDate");
$("#menu-item-1 .day").text(startDate.getDate());
$("#menu-item-1 .month").text(Util.monthToText(startDate.getMonth()));
$("#menu-item-1 .year").text(startDate.getFullYear());
var endDate = $("#end-date").datepicker("getDate");
.hll { background-color: #ffffcc }
.c { color: #586E75 } /* Comment */
.err { color: #93A1A1 } /* Error */
.g { color: #93A1A1 } /* Generic */
.k { color: #859900 } /* Keyword */
.l { color: #93A1A1 } /* Literal */
.n { color: #93A1A1 } /* Name */
.o { color: #859900 } /* Operator */
.x { color: #CB4B16 } /* Other */
.p { color: #93A1A1 } /* Punctuation */

JavaScript Code Style

  • Tab indentation
  • Single-quotes
  • Semicolon
  • Strict mode
  • No trailing whitespace
  • Variables where needed
  • Multiple variable statements (not sure, but want to try)
  • Space after keywords and between arguments and operators
{
"cmd": ["java", "-jar", "C:\\Utilities\\SoyToJsSrcCompiler.jar", "--outputPathFormat", "../${file_base_name}.js", "${file}"],
"selector": "source.soy"
}
/**
* Array.indexOf Polyfill (courtesy of MDN)
*/
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(searchElement /*, fromIndex */ ) {
if (this === null) {
throw new TypeError();
}
var t = new Object(this);
var len = t.length >>> 0;

HTML5/JS/CSS Templates w/ Grunt

File structure

./css
  ./css/main.css
./dist
  .all.css
  ./all.js

./fallback

/********************
* TOOLTIP CSS
*/
.nvtooltip {
position: absolute;
background-color: rgba(255,255,255,1);
padding: 10px;
border: 1px solid #ddd;