This file contains 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
<? | |
$m = new Mongo(MONGO_HOST); | |
$db = $m->{MONGO_DB}; | |
$col = $db->video; | |
$obj = ['this' => 'is a test', 'and this' => [1,2,3,4,5]]; | |
$col->save($obj); |
This file contains 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
cwidth = 160 | |
cheight = 90 | |
cborder = 1 | |
mheight = (cheight*3) + (cborder*2) | |
.montage | |
width 960px | |
height unit(mheight, px) | |
margin auto |
This file contains 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
#!/bin/bash | |
# turn on epel repo | |
sed -i '/^\[epel\]$/,/^\[/ s/^enabled=0/enabled=1/' /etc/yum.repos.d/epel.repo | |
yum -y update | |
# php5.5, httpd 2.4, nodejs and npm | |
yum -y install httpd24 php55 php55-devel git gcc nodejs npm | |
# jade |
This file contains 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
cathighlight: | |
re = new RegExp(search.string, 'gi') | |
$('.search .right .category').each (i, el) -> | |
console.log $(el).html() |
This file contains 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
ServerLimit 2048 | |
MaxRequestWorkers 2048 | |
ServerSignature Off | |
ServerTokens ProductOnly | |
TraceEnable Off | |
EnableMMAP on | |
EnableSendfile on |
This file contains 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
<? | |
private static function checkProcess() { | |
exec('pgrep -xlf "node srv/jade_web.js"', $output); | |
if (count($output) < 1) { | |
return false; | |
} | |
return true; | |
} |
This file contains 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
slide.callback(1, { | |
on: function() { | |
return this.addClass('active'); | |
}, | |
off: function() { | |
return this.removeClass('active'); | |
} | |
}); | |
slide.callback(2, { |
This file contains 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
slide = | |
c: {} | |
o: [] | |
callbacks: {} | |
current: 0 | |
prospect: 0 |
This file contains 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
#!/bin/bash | |
function ajprompt() { | |
if [ $? = "0" ]; then cmd=1; else cmd=0; fi | |
local db="\[\033[1;34m\]" | |
local lb="\[\033[1;34m\]" | |
local dg="\[\033[0;32m\]" | |
local lg="\[\033[1;32m\]" |
This file contains 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
return transition = function(el, time) { | |
var css, key, s, value, _results; | |
console.log(el.length); | |
s = time / 1000; | |
css = { | |
'-webkit-transition-duration': "" + s + "s", | |
'-moz-transition-duration': "" + s, | |
'-o-transition-duration': "" + s, | |
'-ms-transition-duration': "" + s, | |
'transition-duration': "" + s, |
OlderNewer