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
var cmd = './lib/bin/nodeshot ' + remote_url + ' ' + path + filename + ' ' + width + 'x' + height; | |
child = exec(cmd, {timeout: 20000}, function(error, stdout, stderr) { | |
//handler code here | |
} |
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
function retentionCalculator(opts) { | |
var opts = opts || {}; | |
this.init = function(opts) { | |
this.price = opts.price || 300; //Product Price | |
this.margin = opts.margin || 0.085; //Profit Margin | |
this.cost = opts.cost || 0; //Retention Cost | |
this.lifetime = opts.lifetime || 3; //Product Lifetime | |
this.inflation = opts.inflation || 0.05; //Inflation Rate | |
this.network = opts.network || 100; //Network Size | |
this.influence = opts.influence || 0.01; //Network Conversion Influence |
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
# | |
# Virtual Hosts | |
# | |
# If you want to maintain multiple domains/hostnames on your | |
# machine you can setup VirtualHost containers for them. Most configurations | |
# use only name-based virtual hosts so the server doesn't need to worry about | |
# IP addresses. This is indicated by the asterisks in the directives below. | |
# | |
# Please see the documentation at |
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
# | |
# Virtual Hosts | |
# | |
# If you want to maintain multiple domains/hostnames on your | |
# machine you can setup VirtualHost containers for them. Most configurations | |
# use only name-based virtual hosts so the server doesn't need to worry about | |
# IP addresses. This is indicated by the asterisks in the directives below. | |
# | |
# Please see the documentation at | |
# <URL:http://httpd.apache.org/docs/2.2/vhosts/> |
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/env ruby | |
# | |
# A 30 second hack job to compare two CSV files | |
# | |
file1 = ARGV[0] ? ARGV[0] : false | |
file2 = ARGV[1] ? ARGV[1] : false | |
file1_set = [] | |
file2_set = [] | |
delta = [] |
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
/** | |
* Returns document meta description | |
*/ | |
getMetaDescription = function() { | |
var metas = document.getElementsByTagName('meta'); | |
for(var i in metas) { | |
if (typeof(metas[i].name) != 'undefined' && metas[i].name.toLowerCase() == "description") { | |
return encodeURIComponent(metas[i].content); | |
} | |
} |
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
class RobotGuidanceSystem | |
attr_accessor :schematics | |
def initialize(input_file) | |
self.schematics = [] | |
f = File.open(input_file) if File.exists? input_file | |
parse_schematics f.read if f | |
end | |
def run |
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
<?php | |
/** | |
* @file My Drush Commands | |
*/ | |
/** | |
* Implementation of hook_drush_help() | |
*/ | |
function my_drush_help($section) { | |
switch ($section) { |
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
reduce = function(key,vals) { | |
return vals.sort(function(a,b){return b - a})[0]; | |
} | |
map = function() { | |
var map_send = function(k,v) { | |
emit(k,v.toString().length); | |
} | |
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
select c.uid, c.cid, c.created | |
from ( | |
select uid, max(created) as maxcreated | |
from comment group by uid | |
) as x inner join comment as c on c.uid = x.uid and c.created = x.maxcreated | |
order by maxcreated desc |