Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
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
var mysql = require('mysql') | |
, bcrypt = require('bcrypt') | |
, db = { | |
host: 'localhost', | |
user: 'root', | |
database: 'prod' | |
}; | |
function checkUser(email, password, callback) { | |
var connection = mysql.createConnection(db); |
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
# RAILS_ROOT/lib/tasks/assets.rake | |
namespace :assets do | |
desc 'Precompile assets and upload to S3' | |
task :upload, [:noop] => ['assets:clean', 'assets:precompile'] do |_, args| | |
args.with_defaults(noop: false) | |
Fog.credentials_path = "#{Rails.root}/config/fog_credentials.yml" | |
Dir.chdir("#{Rails.root}/public") do | |
assets = FileList['assets',"assets/**/*"].inject({}) do |hsh, path| |
Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST
requests with voice file encoded in FLAC format, and query parameters for control.
client
The client's name you're connecting from. For spoofing purposes, let's use chromium
lang
Speech language, for example, ar-QA
for Qatari Arabic, or en-US
for U.S. English
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" | |
begin | |
require 'sequel' | |
rescue LoadError | |
puts "Please run gem install sequel" | |
exit! | |
end | |
DB = Sequel.connect(:adapter => 'mysql2', | |
:host => '127.0.0.1', |
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
desc "creates database & database user" | |
task :create_database do | |
set :root_password, Capistrano::CLI.password_prompt("MySQL root password: ") | |
set :db_user, Capistrano::CLI.ui.ask("Application database user: ") | |
set :db_pass, Capistrano::CLI.password_prompt("Password: ") | |
set :db_name, Capistrano::CLI.ui.ask("Database name: ") | |
run "mysql --user=root --password=#{root_password} -e \"CREATE DATABASE IF NOT EXISTS #{db_name}\"" | |
run "mysql --user=root --password=#{root_password} -e \"GRANT ALL PRIVILEGES ON #{db_name}.* TO '#{db_user}'@'localhost' IDENTIFIED BY '#{db_pass}' WITH GRANT OPTION\"" |