- Use one-time-bind on expressions ( {{::value}} )
- Replace
$scope.$apply()
with$scope.$digest()
whenever possible - Move filters to controllers
To get the total watchers on the current page, you can run this script on the browser console:
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
$scope.$apply()
with $scope.$digest()
whenever possibleTo get the total watchers on the current page, you can run this script on the browser console:
<VirtualHost *> | |
ServerName example.com | |
WSGIDaemonProcess www user=max group=max threads=5 | |
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
<Directory /home/max/Projekte/flask-upload> | |
WSGIProcessGroup www | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow |
rails new myapp --database=postgresql
rails generate foundation:install
rails generate devise_install
rails generate controller home index
rails generate migration create_relationship_table
rails destroy controller lalala
rails destroy model yadayada
rails destroy scaffold hohoho // After destroying, rake db:rollback!
CalcTrack = function(){ | |
this.isInsideTheCircunference = function(track, stop, radius){ | |
var trackC1 = track.posicao[0]; | |
var trackC2 = track.posicao[1]; | |
var stopC1 = stop.posicao[0]; | |
var stopC2 = stop.posicao[1]; | |
if(Math.sqrt(Math.pow(trackC1-trackC2,2) + Math.pow(stopC1-stopC2,2)) <= radius){ | |
return true; |
//agora vai | |
for(id_pontoreferencia in obj_diff){ | |
for(id_linha in obj_diff[id_pontoreferencia]){ | |
diff = this.getDiff(obj_diff[id_pontoreferencia][id_linha]); | |
this.update(id_pontoreferencia, id_linha, diff.max()/60); | |
//zera diff de cada linha do ponto | |
diff = []; | |
} | |
} |
import re | |
import mechanize | |
#from bs4 import BeautifulSoup | |
class Crawler: | |
def __init__(self): | |
self.url_list = [] | |
self.loop = 0 | |
def get_url_regex(self, url): |
def equilibrium(A): | |
P_arr = [] | |
ini_range = 1 | |
end_limit = len(A) - 2 | |
for x in xrange(ini_range, end_limit): | |
sum_prev = sum(xrange(ini_range,x-1)) | |
sum_pos = sum(xrange(x+1,end_limit)) | |
if(sum_prev == sum_pos): | |
P_arr.append(x) | |
return P_arr |
var https = require('https'), | |
http = require('http'), | |
optionsget = { | |
host : 'maps.googleapis.com', // here only the domain name | |
path : '/maps/api/directions/json?origin=Toledo&destination=Madrid®ion=es&key=key', // the rest of the url with parameters if needed | |
method : 'GET', // do GET | |
json:true | |
}; | |
// do the GET request |
var request = require('request'); | |
// Set the headers | |
var headers = { | |
'User-Agent': 'Super Agent/0.0.1', | |
'Content-Type': 'application/x-www-form-urlencoded' | |
} | |
// Configure the request | |
var options = { |