This file contains hidden or 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/python | |
| import subprocess | |
| import sys | |
| import simplejson as json | |
| import csv | |
| from geoip import geolite2 | |
| from geoip import open_database | |
| import pygeoip | |
| geo_isp = pygeoip.GeoIP("GeoIPASNum.dat") |
This file contains hidden or 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
| 'use strict' | |
| angular.module('kreditorenApp').factory 'UserService', [ | |
| '$q', '$http', 'AuthService', '$state', '$alert' | |
| ($q, $http, AuthService, $state, $alert) -> | |
| { | |
| signIn: (user) -> | |
| # verify form fill or other | |
| if user.email != '' and user.password != '' | |
| $http.post('/user/signin', user) # POST | |
| # Avoiding the $http module's unchainable .success and .error promises |
This file contains hidden or 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
| beforeEach -> | |
| # Stub Dependencies for test isolation | |
| myServiceMock = () -> | |
| { | |
| set: (entidy, value) -> | |
| return | |
| get: (entidy) -> | |
| # mock | |
| localStorageMock = | |
| email : 'peter' |
This file contains hidden or 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
| $http.get('https://api.github.com/users/peterbe/gists').then((response) -> | |
| $scope.gists = response.data | |
| return | |
| ).catch((response) -> | |
| console.error 'Gists error', response.status, response.data | |
| return | |
| ).finally -> | |
| console.log 'finally finished gists' | |
| return |
This file contains hidden or 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
| $http.get('https://api.github.com/users/peterbe/gists').success((data) -> | |
| $scope.gists = data | |
| return | |
| ).error((data, status) -> | |
| console.error 'Repos error', status, data | |
| return | |
| ).finally -> | |
| console.log 'finally finished repos' | |
| return |
This file contains hidden or 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
| describe 'AuthController Unit Tests', -> | |
| # Load Module that contains controller | |
| # | |
| beforeEach angular.mock.module('kreditorenApp') | |
| mockScope = undefined | |
| $http = undefined | |
| UserService = undefined | |
| user = undefined |
This file contains hidden or 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
| # | |
| # Upstart Configuration File for Ubuntu 14.10 - to run syncthing | |
| # | |
| # Created 27 Dec 2014 - initial file written based on version from | |
| # Syncthing forums here: | |
| # https://forum.syncthing.net/t/keeping-syncthing-running-ubuntu-upstart/30 | |
| # | |
| # | |
| # BEFORE USE: change: | |
| # |
This file contains hidden or 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
| grunt.initConfig({ | |
| sshconfig: { | |
| awesome: { | |
| host: 'awesome.tld', | |
| port: '22', | |
| privateKey: grunt.file.read(process.env['HOME'] + '/.ssh/id_rsa'), | |
| username: 'ben', | |
| agent: process.env.SSH_AUTH_SOCK | |
| } | |
| }, |
This file contains hidden or 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
| server { | |
| listen 80; | |
| server_name localhost; | |
| location / { | |
| proxy_pass http://localhost:9000; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection 'upgrade'; | |
| proxy_set_header Host $host; |
This file contains hidden or 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
| 'use strict'; | |
| var express = require('express'); | |
| module.exports = function(app) { | |
| // Serve all asset files from necessary directories | |
| // | |
| var appPath = app.get('appPath') | |
| app.use('/bower_components', express.static(appPath + "/bower_components/")); |