- 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:
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: dropbox | |
# Required-Start: $local_fs $remote_fs $network $syslog $named | |
# Required-Stop: $local_fs $remote_fs $network $syslog $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# X-Interactive: false | |
# Short-Description: dropbox service | |
### END INIT INFO |
'use strict'; | |
var _ = require('lodash'), | |
async = require('async'), | |
Bluebird = require('bluebird'), | |
mongodb = Bluebird.promisifyAll(require('mongodb')), | |
using = Bluebird.using; | |
var concurrency = 3; | |
var totalCount = 0; |
$scope.$apply()
with $scope.$digest()
whenever possibleTo get the total watchers on the current page, you can run this script on the browser console:
@pulkitsinghal here’s a gist of the core of it all:
https://gist.github.com/doublemarked/e4bf329d11c55baf468f
@pulkitsinghal this will log access tokens with all log messages.
Bunyan produces JSON, so you’re essentially going to need to parse
the log to fish out things, but JSON makes it easy to do that.
For simple things (like access tokens) you can also use grep
// example function where arguments 2 and 3 are optional | |
function example( err, optionalA, optionalB, callback ) { | |
// retrieve arguments as array | |
var args = []; | |
for (var i = 0; i < arguments.length; i++) { | |
args.push(arguments[i]); | |
} | |
// first argument is the error object |
#!/usr/bin/env ruby | |
message_file = ARGV[0] | |
message = File.read(message_file) | |
$regex = /issues?\s+#(\d+)/ | |
if !$regex.match(message) | |
puts "[POLICY] Please reference an issue in your commit." | |
exit 1 | |
end |
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'json' | |
message_file = ARGV[0] | |
message = File.read(message_file) | |
$regex = /#(\d+)/ | |
def get_issues | |
uri = URI('github.com/user/repo/issues') |
#!/usr/bin/ruby | |
# | |
# Called by "git commit" with the | |
# name of the file that has the | |
# commit message, followed by | |
# the description of the commit | |
# message's source. The hook's | |
# purpose is to edit the commit | |
# message file. If the hook fails | |
# with a non-zero status, |
echo -e "\nInstalling development dependencies and essential tools..." \ | |
"\n===============================================================================\n" | |
yum install gcc gcc-c++ make automake install ruby-devel libcurl-devel libxml2-devel libxslt-devel vim tree curl git -y | |
echo -e "\nInstalling Rubygems..." \ | |
"\n===============================================================================\n" | |
yum install rubygems -y | |
echo -e "\nInstalling and bootstrapping Chef..." \ | |
"\n===============================================================================\n" |