$ cat /etc/apache2/sites-enabled/mms-test
Listen 50690
LogLevel debug
DumpIOInput On
# DumpIOOutput On
$ sudo tail -f /var/log/apache2/error.log | grep "mod_dumpio.c(74)" | sed "s/.*HEAP.: //"
#!/bin/bash | |
# Script to convert PDF file to JPG images | |
# | |
# Dependencies: | |
# * pdftk | |
# * imagemagick | |
PDF=$1 |
## calculates probability of winning a tennis match from any given score dependent on the skill levels | |
## of the two players | |
## requires functions in other gists: | |
## gameProb: https://gist.github.com/768862 | |
## setGeneral: https://gist.github.com/776986 | |
## tiebreakProb: https://gist.github.com/776875 | |
def fact(x): | |
if x in [0, 1]: return 1 |
var vm = require('vm'), | |
code = 'var square = n * n;', | |
fn = new Function('n', code), | |
script = vm.createScript(code), | |
sandbox; | |
n = 5; | |
sandbox = { n: n }; | |
benchmark = function(title, funk) { |
// Target API: | |
// | |
// var s = require('net').createStream(25, 'smtp.example.com'); | |
// s.on('connect', function() { | |
// require('starttls')(s, options, function() { | |
// if (!s.authorized) { | |
// s.destroy(); | |
// return; | |
// } | |
// |
var mongoose = require('./db-connect'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId, | |
uuid = require('node-uuid'), | |
Validator = require('validator').Validator, | |
val = new Validator(), | |
bcrypt = require('bcrypt'); | |
Validator.prototype.error = function(msg) { return false; }; |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
var http = require('http') | |
, formidable = require('formidable') | |
, fs = require('fs') | |
, qs = require('querystring') | |
, util = require('util') | |
, uploads = {}; | |
http.createServer(function(req, res){ | |
if(req.method == 'GET') { | |
if(req.url != '/favicon.ico') { |