- 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:
$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 |
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): |
<?php | |
trait MetaClass | |
{ | |
protected $__classMethods = array(); | |
static protected $__staticMethods = array(); | |
public function __call($name, $args) | |
{ |
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 = { |
//retunr 1 , if there exits a certain group of Z numbers selected from the array | |
//such that their sum equals N | |
//HackerRank passing 13/14 | |
exports.isSumPossibleZ = function(A, n, Z) { | |
var sum = function(A, pastSums, Z){ | |
//each execution run 2 by default, so Z is Z-2 | |
Z = Z-2; | |
if(Z <= 0){ | |
Z = 0; | |
} |