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
(function ($) { | |
$.fn.formNavigation = function () { | |
$(this).each(function () { | |
$(this).find('input').on('keyup', function(e) { | |
switch (e.which) { | |
case 39: | |
$(this).closest('td').next().find('input').focus(); break; | |
case 37: | |
$(this).closest('td').prev().find('input').focus(); break; | |
case 40: |
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
(function (window, document) { | |
var settings = { | |
dataId: 'data-myModule-id', | |
url: '/api/mymodule/' | |
}; | |
function load() { | |
var elems = document.querySelectorAll('[' + settings.dataId + ']'); | |
if (!elems) { |
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
export const LogLevels = { | |
log : 0, | |
info : 1, | |
warn : 2, | |
error : 3 | |
} | |
function clone(arr) { | |
return arr.map(a => JSON.parse(JSON.stringify(a))) | |
} |
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
root = true | |
[*] | |
indent_style = tab | |
indent_size = 4 |
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
const data = { | |
browser: { | |
name: 'Chrome', | |
version: '52.4.53.123', | |
os: 'Mac' | |
}, | |
env: 'development', | |
settings: { | |
audioConference: { | |
release: '2016-10-23 22:34:12' |
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
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile | |
# Programs | |
# ------------------------------------------------------------------------------ | |
alias subl="open -a /Applications/Sublime\ Text\.app" | |
alias vsc="open -a /Applications/Visual\ Studio\ Code.app" | |
alias sim="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app" | |
# less syntax highlight | |
LESSPIPE=`which src-hilite-lesspipe.sh` |
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
CREATE TABLE #TestData ( | |
id int not null identity(1,1) primary key, | |
account varchar(10) not null, | |
deposit int not null | |
); | |
INSERT INTO #TestData (account, deposit) VALUES ('Vacation', 10) | |
INSERT INTO #TestData (account, deposit) VALUES ('Vacation', 20) | |
INSERT INTO #TestData (account, deposit) VALUES ('Vacation', 30) | |
INSERT INTO #TestData (account, deposit) VALUES ('Bills', 40) | |
INSERT INTO #TestData (account, deposit) VALUES ('Bills', 50) |
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
export function create() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | |
var r = Math.random() * 16 | 0, | |
v = c === 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); | |
} | |
var guid = require('js/guid'); |
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
import { OnDestroy, OnInit } from '@angular/core' | |
export type VoidFunction = () => void | |
export interface ReactAppInit { | |
default(component: Element, ...args: any[]): VoidFunction | |
} | |
export default class ReactLoaderComponent<T extends {}> implements OnInit, OnDestroy { | |
constructor( |
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
import React from 'react' | |
import { render, unmountComponentAtNode } from 'react-dom' | |
/** | |
* Creates a function that will render a React component into a target element and return an unmount function. | |
* The entry point should be loaded async by a ReactLoader component to ensure code splitting. | |
* @param component Root component to render | |
*/ | |
export default <P>(component: React.ComponentType<P>) => (domElement: Element, props: P) => { | |
render(React.createElement(component, props), domElement) |