Syntax check php files in folders:
find ./foo ./bar \( -name "*.php" -or -name "*.phtml" \) -print0 | xargs -0 -n 1 php -l
Syntax check php files in folders:
find ./foo ./bar \( -name "*.php" -or -name "*.phtml" \) -print0 | xargs -0 -n 1 php -l
from deployment.cuisine import * | |
from fabric.api import * | |
from fabric.context_managers import * | |
from fabric.utils import puts | |
from fabric.colors import red, green | |
import simplejson | |
import os |
# config/initializers/action_mailer_ext.rb | |
# For Rails 2.x | |
if Rails.env.staging? | |
class ActionMailer::Base | |
def recipients(*params) | |
@recipients = "[email protected]" | |
end | |
UPDATE movie_log | |
INNER JOIN ( | |
SELECT | |
item_id, | |
date, | |
view + | |
( | |
comment * | |
( |
Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.
First install motion
:
~> sudo apt-get install motion
Then create a config file:
~> mkdir ~/.motion
~> nano ~/.motion/motion.conf
var net = require('net') | |
var sock = net.connect(1337) | |
process.stdin.pipe(sock) | |
sock.pipe(process.stdout) | |
sock.on('connect', function () { | |
process.stdin.resume(); | |
process.stdin.setRawMode(true) |
app.use(express.methodOverride()); | |
// ## CORS middleware | |
// | |
// see: http://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs | |
var allowCrossDomain = function(req, res, next) { | |
res.header('Access-Control-Allow-Origin', '*'); | |
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization'); | |
var express = require('express'), spawn = require('child_process').spawn; | |
var app = express.createServer(); | |
app.use(app.router); | |
var tail; | |
app.get('/tail', function(req, res) { | |
res.header('Content-Type','text/html;charset=utf-8'); | |
tail = spawn('tail', ['-f', './test.log']); |
#!/bin/bash | |
############################################### | |
# To use: | |
# https://raw.github.com/gist/2776351/??? | |
# chmod 777 install_postgresql.sh | |
# ./install_postgresql.sh | |
############################################### | |
echo "*****************************************" | |
echo " Installing PostgreSQL" | |
echo "*****************************************" |
#!/bin/sh | |
svn diff --diff-cmd diff -x -uw $* |