Skip to content

Instantly share code, notes, and snippets.

View sasha7's full-sized avatar

Sasa Macakanja sasha7

View GitHub Profile
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream websocket {
server 127.0.0.1:8010;
}
server {
@sasha7
sasha7 / prezto-install.sh
Created March 13, 2016 06:39 — forked from kaplas/prezto-install.sh
Install prezto to a vagrant/*nix box with a single command
#!/bin/zsh
#
# This script installs prezto into a vagrant/*nix box which already has zsh and oh-my-zsh
# installed. It also replaces the prompt color and enables the git prezto module. If
# executed via the suggested command below, also the default shell is changed into zsh.
# BTW, if using this for a vagrant box, be sure to execute the command while ssh'd into
# the box.
#
# Usage: curl -L https://raw-gist-file-address-here.sh | zsh && chsh -s $(which zsh)
#
import {Injectable, provide} from 'angular2/core';
import {Observable} from 'rxjs';
const GEOLOCATION_ERRORS = {
'errors.location.unsupportedBrowser': 'Browser does not support location services',
'errors.location.permissionDenied': 'You have rejected access to your location',
'errors.location.positionUnavailable': 'Unable to determine your location',
'errors.location.timeout': 'Service timeout has been reached'
};
@sasha7
sasha7 / NodoSocket.service.ts
Created November 23, 2015 13:15 — forked from joeherold/NodoSocket.service.ts
a sample implementation of socket.io in angular2 and typescript
/**!
* nodocms backend application
* Copyright(c) 2015 Johannes Pichler - webpixels
* Created by johannespichler on 23.11.15.
* LGPLv3.0 Licensed
**/
@sasha7
sasha7 / app.ts
Last active October 17, 2015 00:35
Angular 2 0.44 router example
import {provide, bootstrap} from 'angular2/angular2';
import {Component} from 'angular2/angular2';
import {CORE_DIRECTIVES} from 'angular2/angular2';
import {RouteConfig, ROUTER_DIRECTIVES, LocationStrategy, HashLocationStrategy, Location, RouterOutlet} from 'angular2/router';
import {ComponentA} from './componenta_folder/componenta';
import {ComponentB} from './componentb_folder/componentb';
import {ComponentC} from './componentc_folder/componentc';