Skip to content

Instantly share code, notes, and snippets.

/*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));
}
@curiouslychase
curiouslychase / 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"
],
@curiouslychase
curiouslychase / 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>
# Make that Command Prompt look good
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWSTASHSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
usrcolor='\e[0;31m'
dircolor='\e[m:\e[1;34m'
gitcolor='\e[1;32m'
closer='\e[m'
gitstatus='$(__git_ps1 " %s")'
@curiouslychase
curiouslychase / changelog.sublime-snippet
Created August 15, 2014 14:21
A CHANGELOG snippet for all the content you'd type every time. Tabbing takes you to the next placeholder.
<snippet>
<content><![CDATA[
## ${1:Release Version}
### Added
${2:Added}
### Deprecated
${3:Deprecated}
@curiouslychase
curiouslychase / FlatLand.itermcolors
Created September 4, 2014 04:16
Flatland color scheme for iTerm2
<?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>
/**
* Usage:
* var q = new QueryParser();
*/
var QueryParser = function(option) {
var config = option || {};
var queriesMap = {};
var queryString = config.queryString !== undefined ? config.queryString : location.search;
return {
/**