| Dynamic access to current branch name with the current_branch function |
|---|
| git pull origin $(current_branch) |
| grb publish $(current_branch) origin |
| Alias | Command |
|---|---|
| g | git |
| export class Hsva { | |
| constructor(public h: number, public s: number, public v: number, public a: number) { } | |
| } | |
| export class Hsla { | |
| constructor(public h: number, public s: number, public l: number, public a: number) { } | |
| } | |
| export class Rgba { | |
| constructor(public r: number, public g: number, public b: number, public a: number) { } | |
| } | |
| export class SliderPosition { |
| // Array literal (= []) is faster than Array constructor (new Array()) | |
| // http://jsperf.com/new-array-vs-literal/15 | |
| var array = []; | |
| // Object literal (={}) is faster than Object constructor (new Object()) | |
| // http://jsperf.com/new-array-vs-literal/26 | |
| var obj = {}; | |
| // property === undefined is faster than hasOwnProperty(property) | |
| // http://jsperf.com/hasownproperty-vs-in-vs-undefined/17 |
| /* | |
| * jQuery ScrollSpy Plugin | |
| * Author: @sxalexander, softwarespot | |
| * Licensed under the MIT license | |
| */ | |
| import $ from 'jquery'; | |
| export default class Scrollspy { | |
| constructor() { |
| const path = require('path'); | |
| /* | |
| * Webpack Plugins | |
| */ | |
| // const webpack = require('webpack'); | |
| // const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
| module.exports = { |
| var mongoObjectId = function () { | |
| var timestamp = (new Date().getTime() / 1000 | 0).toString(16); | |
| return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() { | |
| return (Math.random() * 16 | 0).toString(16); | |
| }).toLowerCase(); | |
| }; |
| import {BrowserXhr, HTTP_PROVIDERS} from "angular2/http"; | |
| import {Injectable, provide} from "angular2/core"; | |
| @Injectable() | |
| class CORSBrowserXHR extends BrowserXhr{ | |
| build(): any{ | |
| var xhr:any = super.build(); | |
| xhr.withCredentials = true; | |
| return xhr; | |
| } |
| Atom settings synchronization |
| # EditorConfig helps developers define and maintain consistent | |
| # coding styles between different editors and IDEs | |
| # editorconfig.org | |
| root = true | |
| [*] | |
| # Change these settings to your own preference | |
| indent_style = space |
| var fs = require('fs'); | |
| var path = require('path'); | |
| var atomPackagesPath = path.join(process.env.HOME, '.atom/packages'); | |
| fs.readdirSync(atomPackagesPath).forEach(function(current) { | |
| var packagePath = path.join(atomPackagesPath, current); | |
| if (fs.statSync(packagePath).isDirectory()) { | |
| var p = require(packagePath + '/package.json'); |