Skip to content

Instantly share code, notes, and snippets.

View hshoff's full-sized avatar
📊

Harrison Shoff hshoff

📊
View GitHub Profile
@hshoff
hshoff / full-saturn.md
Last active August 29, 2015 14:05
Full Saturn

screen shotty

Based on Saturn by @psql

Full Saturn is an updated color theme of Spacegray by @kkga.

If you already have Theme - Spacegray installed skipped to step 5.

Janky manual install due to laziness

@hshoff
hshoff / PrettyPrint.js
Last active August 29, 2015 14:01
Pretty print objects with JSON.stringify
function print(obj) {
console.log(JSON.stringify(obj, null, 2));
};
print({one:1,two:[{name:'charles',label:'barkley'},{name:'han',label:'solo'}]};
// {
// "one": 1,
// "two": [
// {
{
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/Theme - Spacegray/base16-eighties2.dark.tmTheme",
"draw_minimap_border": true,
"draw_indent_guides": true,
"fade_fold_buttons": false,
"font_size": 13.0,
"highlight_active_indent_guide": true,
@hshoff
hshoff / base16-eighties2.dark.tmTheme
Created March 22, 2014 23:36
my laser beam edition of spacegray
<?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>Chris Kempson (http://chriskempson.com)</string>
<key>name</key>
<string>Base16 Eighties Dark</string>
<key>semanticClass</key>
<string>base16.eighties.dark</string>
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform
// specific settings file, for example, "Base File (Linux).sublime-settings".
// Because of this, setting them here will have no effect: you must set them
// in your User File Preferences.
"font_face": "Monaco",
"font_size": 12,
SELECT u.country, COUNT(distinct user_id), COUNT(distinct hosting_id), COUNT(*)
FROM users u
JOIN hostings h ON (u.id = h.user_id)
JOIN reservations r ON (u.id = r.host_id)
WHERE h.has_availability = '1' AND r.status = '1' AND r.created_at >= '2011-01-01'
GROUP BY u.country;
SELECT d, COUNT(*)
FROM test_table
WHERE d >= '2012-05-01'
GROUP BY d
ORDER BY d ASC;
// module1.js
;(function() {
console.log('module1');
})()
// crockford module1.js
;(function(){
console.log('module1');
}())
// crockford problem
(function(){console.log('module1');}())(function(){console.log('module2');}());
// => module1
// => module2
// => TypeError: undefined is not a function
// it invokes module1
(function(){ console.log('module1'); }())
// => module1
// it invokes module1
(function(){ console.log('module1'); return function(){ console.log(arguments); };}())
// => module1
//it invokes module2
(function(){ console.log('module2'); }());
// => module2
// equivalent
(function(){ console.log(arguments); })(undefined)