This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type TemplateType = { | |
template: string; | |
id: string; | |
}; | |
function withTemplate(templateObj: TemplateType) { | |
return function (constructor: any) { | |
let el = document.getElementById(templateObj.id); | |
let p = new constructor(); | |
if (el) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Based on http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/ | |
7. Provide filtering, sorting, field selection and paging for collections | |
*/ | |
/****** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An individual movie | |
useQuery(['movies', 5], ...); | |
// A list of movies that are "released" | |
useQuery(['movies', { type: 'released' }], ...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"log" | |
// load postgres driver | |
_ "github.com/lib/pq" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Set this variable to 1 to fix files when you save them. | |
let g:ale_fix_on_save = 1 | |
highlight ALEWarning ctermbg=DarkMagenta | |
highlight ALEError ctermbg=DarkBlue | |
" Enable completion where available. | |
" This setting must be set before ALE is loaded. | |
let g:ale_completion_enabled = 1 | |
let g:ale_fixers = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = { image: "image.jpg", text: "text..." }; | |
var popup = webkitNotifications.createHTMLNotification( | |
'notification.html#' + encodeURIComponent(JSON.stringify(data)) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# Custom tmux configuration cobbled together from google and trial & error | |
# by Eric Marden (xentek.net), heavily modified by David Rogers (@al-the-x). | |
## | |
# set the command prefix to match gnuscreen (i.e. CTRL+a) | |
set-option -g prefix C-a | |
# use the NEW prefix key to "send-prefix" instead of the default | |
unbind-key C-b; bind-key C-a send-prefix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Built with IMPACT - impactjs.org | |
(function (window) { | |
"use strict"; | |
Number.prototype.map = function (istart, istop, ostart, ostop) { | |
return ostart + (ostop - ostart) * ((this - istart) / (istop - istart)); | |
}; | |
Number.prototype.limit = function (min, max) { | |
return Math.min(max, Math.max(min, this)); | |
}; | |
Number.prototype.round = function (precision) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
noremap f e | |
noremap p r | |
noremap b t | |
noremap j y | |
noremap l u | |
noremap u i | |
noremap y o | |
noremap ' p | |
noremap r s | |
noremap s d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sublime.log_commands(True) |
OlderNewer