Skip to content

Instantly share code, notes, and snippets.

View cosemansp's full-sized avatar

Peter Cosemans cosemansp

  • Euricom
  • Belgium
View GitHub Profile
@cosemansp
cosemansp / gist:9a595b3e29deb94d8440
Last active August 29, 2015 14:06
Bower & Node after proxy server
npm config set proxy <your proxy server address:port>
npm config set https-proxy <your proxy server address:port>
npm config set registry=http://registry.npmjs.org/
git config --global url."https://".insteadOf git://
set http_proxy=<your proxy server address:port>
set https_proxy=<your proxy server address:port>
or create .bowerrc
@cosemansp
cosemansp / gist:d89c9dc262ebf1060cee
Created September 17, 2014 15:01
Remove node_modules with (to) long file names
npm install -g rimraf
rimraf <dir>
@cosemansp
cosemansp / gist:f608b8d9086b610afbef
Created January 31, 2015 10:19
Azure node deploy
# Deployment
# ----------
echo Handling node.js grunt deployment.
# 1. Select node version
selectNodeVersion
# 2. Install npm packages
if [ -e "$DEPLOYMENT_SOURCE/package.json" ]; then
@cosemansp
cosemansp / gist:cece7ce163704c6f50dc
Created March 27, 2015 15:49
How to delete files permanently from your local and remote git repositories
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all
Replace FOLDERNAME with the file or folder you wish to remove from the given git repository.
Once this is done run the following commands to clean up the local repository
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now

@Input / @Output

@Component({
	selector: 'ng2-markdown',
	inputs: [ 'source' ],
	outputs: [ 'modified' ]
})

export class MyComponent {

constructor () {

@cosemansp
cosemansp / .eslintrc
Created April 17, 2016 10:35 — forked from dermike/.eslintrc
eslint
{
"env": {
"browser": true,
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
@cosemansp
cosemansp / .eslintrc.json
Created April 17, 2016 10:44 — forked from egamma/.eslintrc.json
Visual Studio Code default .eslintrc.json
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
// beta.15
import { NgZone } from 'angular2/core';
constructor(nav, navParams, apiServer) {
this.zone = new NgZone({ enableLongStackTrace: false });
}
method() {
this.zone.run(() => {
@cosemansp
cosemansp / Typescript for ES6 developers
Last active May 20, 2016 05:50
Typescript for ES6 developers
# Default import from commonJS module
## ES6
import chai, { expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';
chai.use(chaiAsPromised);
## Typescript
import { Subject, Observable } from 'rxjs';
class EventAggregator {
constructor() {
this.subject = new Subject(); // Can be ReplaySubject too
}
publish(type, data) {
this.subject.onNext({ type, data });
}