Skip to content

Instantly share code, notes, and snippets.

View chrisbenseler's full-sized avatar

Christian Benseler chrisbenseler

View GitHub Profile
//http://es6console.com/iy0bc530/
function compare_lists(full_list, partial_list) {
return full_list.filter( item => partial_list.indexOf(item) < 0 )
}
let all_animals = ['dog', 'parrot', 'cat', 'mouse']
let my_animals = ['dog', 'cat']
let animalsdontown = compare_lists(all_animals, my_animals)
import { Injectable } from "@angular/core";
import { Observable } from 'rxjs/Observable';
import { CustomHttp } from "./customhttp";
@Injectable()
export class MyService {
constructor(public http: CustomHttp) {
}
import { Injectable } from "@angular/core";
import { Http, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Observable';
@Injectable()
export class CustomHttp {
constructor(public http: Http) {
@chrisbenseler
chrisbenseler / gist:5547336
Last active December 17, 2015 03:59
Useful git commands
#commit all deleted files in Git?
git add -u .
#creating branch
git checkout -b your_branch
git push -u origin your_branch
#Teammates can reach your branch, by doing:
git fetch
git checkout origin/your_branch
@chrisbenseler
chrisbenseler / gist:5443758
Created April 23, 2013 13:56
Using jQuery when/then/done
var url = "something";
$
.when( $.ajax({url: url ))
.then( my_function_1 )
.then( my_function_2 )
.done( my_callback_function );
@chrisbenseler
chrisbenseler / grunt steps
Created April 23, 2013 13:52
Steps to prepare a simple grunt project (linux)
sudo npm uninstall -g grunt
sudo npm install -g grunt-cli
sudo grunt-init grunt-init-gruntfile
npm init