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
import sys | |
import os | |
import urllib | |
base_url = "https://maps.googleapis.com/maps/api/place/search/json?location=25.042582,121.513936&radius=500&types=sublocality&sensor=false&key=AIzaSyBhIVUcucpsBPyHvJYu-e29Pewpj953dWM" | |
resp = urllib.urlopen(base_url) | |
print resp.read() |
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
{ | |
"html_attributions" : [], | |
"results" : [ | |
{ | |
"geometry" : { | |
"location" : { | |
"lat" : 25.04498590, | |
"lng" : 121.51059250 | |
}, | |
"viewport" : { |
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
import sys, os | |
import cv | |
def detectObject(image): | |
size = cv.GetSize(image) | |
grayscale = cv.CreateImage(size, 8, 1) | |
cv.CvtColor(image, grayscale, cv.CV_BGR2GRAY) | |
storage = cv.CreateMemStorage(0) | |
cv.EqualizeHist(grayscale, grayscale) | |
cascade = cv.Load("haarcascade_frontalface_alt.xml") |
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
import urllib | |
import httplib | |
import json | |
import time | |
import zlib | |
email = '[email protected]' | |
password = 'abcdef' | |
apikey = 'e965434a-3ed5-540a-9ef2-1f8ce1dc60f2' |
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
start on runlevel[12345] | |
stop on runlevel[06] | |
respawn | |
ulimit -n 65535 | |
if [ -d /usr/lib/node_modules ] ; then | |
export NODE_PATH='/usr/lib/node_modules' | |
else | |
export NODE_PATH='/usr/local/lib/node_modules' | |
fi |
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
set mailserver email-smtp.us-east-1.amazonaws.com port 465 | |
username "XXXXXXXXXXXXXXXXXX" password "XXXXXXXXXXXXXXXX" | |
using sslv3 with timeout 15 seconds using hostname xxxx.example.com | |
set mail-format { | |
from: [email protected] | |
subject: $SERVICE $EVENT at $DATE on $HOST | |
message: Alert from $HOST | |
Date: $DATE | |
For $SERVICE ($EVENT) and take $ACTION | |
--------------------------------------- |
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
set :repository, "[email protected]:your_project/your_git.git" | |
ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "github.pem")] | |
set :scm, "git" | |
set :git_enable_submodules, 1 | |
set :scm_verbose, false | |
set :deploy_to, "/home/code/" |
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
task :develop do | |
set :branch, "release" | |
set :target, "dev.yourweb.com" | |
role :web, "dev.yourweb.com" | |
role :worker, "dev.yourweb.com" | |
role :scheduler, "dev.yourweb.com" | |
role :batch, "dev.yourweb.com" | |
end | |
task :staging do |
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
require 'rubygems' | |
require 'action_mailer' | |
ActionMailer::Base.delivery_method = :smtp | |
ActionMailer::Base.smtp_settings = { | |
:enable_starttls_auto => true, | |
:tls => true, | |
:address => "smtp.gmail.com", | |
:port => 587, | |
:domain => "gmail.com", |
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
namespace :deploy do | |
task :default do | |
transaction do | |
deploy.git_log | |
deploy.update | |
deploy.setup | |
deploy.restart | |
end | |
end |
OlderNewer