Skip to content

Instantly share code, notes, and snippets.

View gajus's full-sized avatar

Gajus Kuizinas gajus

View GitHub Profile
var [..]
tw.stream('statuses/filter', {track: 'JavaScript,html5,angularjs,d3js,webdev'}, function (stream) {
stream.on('data', function (data) {
// big chunk of code that somewhere causes an error
});
stream.on('error', function (data) {
debugger;
console.log('ERR', util.inspect(data));
});
[gajus@web tap]$ node debug tapTrack.js
< debugger listening on port 5858
connecting... ok
break in tapTrack.js:1
1 var exec = require('child_process').exec,
2 util = require('util'),
3 io = require('socket.io')(3000),
debug> c
[..]
break in tapTrack.js:218
<!DOCTYPE html>
<html ng-app="sportsStoreAdmin">
<head>
<title>Administration</title>
<script src="./static/js/angular.js"></script>
<script src="./static/js/ngmodules/angular-route.js"></script>
<script>
angular.module('sportsStoreAdmin', ['ngRoute'])
.config(function ($routeProvider) {
angular.module("sportsStoreAdmin")
.constant("authUrl", "http://localhost:5500/users/login")
.controller("authCtrl", function($scope, $http, $location, authUrl) {
$scope.authenticate = function (user, pass) {
$http.post(authUrl, {
username: user,
password: pass
}, {
withCredentials: true
}).success(function (data) {
angular.module("sportsStoreAdmin")
.constant("authUrl", "http://localhost:5500/users/login")
.controller("authCtrl", function($scope, $http, $location, authUrl) {
$scope.authenticate = function (user, pass) {
$http.post(authUrl, {
username: user,
password: pass
}, {
withCredentials: true
}).success(function (data) {
<div class="row" ng-controller="main">
<ul>
<li ng-repeat="screen in screens" ng-class="{'active': screen == currentScreen}"
ng-click="setScreen($index)"
class="button">{{screen}}</li>
</ul>
</div>
<div ng-include="getScreenView()"></div>
<div class="row" ng-controller="main">
<ul>
<li ng-repeat="screen in screens" ng-class="{'active': screen == currentScreen}"
ng-click="setScreen($index)"
class="button">{{screen}}</li>
</ul>
</div>
<div ng-include="getScreenView()"></div>
angular.module('storeAdmin')
.controller('main', function ($scope) {
$scope.screens = ['Product', 'Order'];
$scope.currentScreen = $scope.screens[0];
$scope.setScreen = function (index) {
$scope.currentScreen = $scope.screens[index];
};
$scope.getScreenView = function () {
angular.module('storeAdmin')
.controller('main', function ($scope) {
$scope.screens = ['Product', 'Order'];
$scope.currentScreen = $scope.screens[0];
$scope.setScreen = function (index) {
$scope.currentScreen = $scope.screens[index];
};
$scope.getScreenView = function () {
var foo = function () {}; foo['bar'] = 'baz'; foo['bar'];