This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Track basic JavaScript errors | |
window.addEventListener('error', function(e) { | |
_gaq.push([ | |
'_trackEvent', | |
'JavaScript Error', | |
e.message, | |
e.filename + ': ' + e.lineno, | |
true | |
]); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
factory('socket', ['$rootScope', 'io', function($rootScope, io) { | |
var socket = io.connect(), | |
events = {}, | |
that = {}; | |
var addCallback = function(name, callback) { | |
var event = events[name], | |
wrappedCallback = wrapCallback(callback); | |
if (!event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appServices.factory('socket', function ($rootScope) { | |
var socket = io.connect('http://localhost:3000'); | |
return { | |
on: function (eventName, callback) { | |
socket.on(eventName, function () { | |
var args = arguments; | |
$rootScope.$apply(function () { | |
callback.apply(socket, args); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
###################################################################### | |
# | |
# File : split_bootimg.pl | |
# Author(s) : William Enck <enck@cse.psu.edu> | |
# Description : Split appart an Android boot image created | |
# with mkbootimg. The format can be found in | |
# android-src/system/core/mkbootimg/bootimg.h | |
# | |
# Thanks to alansj on xda-developers.com for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { | |
AlertDialog.Builder dialog = new AlertDialog.Builder(BlueBand.this); | |
dialog.setTitle("Error"); | |
dialog.setMessage("Support Android 4.3 or above only."); | |
dialog.setNegativeButton("OK", | |
new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
System.exit(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Provider for Socket.io service | |
* first argument is the name of the service (not the name of the provider!) and second one is the constructor function for the provide | |
*/ | |
//angular.module('module').provider('$socket', $socketProvider() { | |
var angular.module('socket.io', []); | |
module.provider('$socket', function $socketProvider() { | |
var ioUrl = ''; | |
var ioConfig = {}; | |
this.setConnectionUrl = function setConnectionUrl(url) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################################################################################### | |
# Complete Nameless setup script for Debian/Ubuntu Systems # | |
########################################################################################### | |
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections | |
export CCACHE_DIR=/home/ccache | |
sed -i 's/main$/main universe/' /etc/apt/sources.list | |
apt-get -qq update | |
apt-get install -y python-software-properties software-properties-common bsdmainutils curl file screen ccache | |
apt-get purge openjdk-\* icedtea-\* icedtea6-\* -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
/** | |
* @class MainCtrl | |
* @classdesc Main Controller for doing awesome things | |
* @ngInject | |
*/ | |
function MainCtrl ($scope, SomeFactory) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var app = angular.module("routedTabs", ["ui.router", "ui.bootstrap"]); | |
app.config(function($stateProvider, $urlRouterProvider){ | |
$urlRouterProvider.otherwise("/main/tab1"); | |
$stateProvider | |
.state("main", { abtract: true, url:"/main", templateUrl:"main.html" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var child = require("child_process"); | |
var async = require("async"); | |
var net = require("net"); | |
var os = require("os"); | |
function scan(port, cb){ | |
var hosts = {}; | |
var result = []; | |
async.series([ | |
function scan(next, c){ |
OlderNewer