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
apt-get install sshfs | |
sshfs -o uid=1000,gid=1000,workaround=rename [email protected]:/home/myuser ./somedir |
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
//=================================== | |
//FAZ A CONEXÃO COM O BANCO========== | |
//=================================== | |
$MySQL = new MySQL($DBHost,$DBUser,$DBPass); | |
$MySQL->DBConnect($DBDataBase); | |
if ( ! isset($_GET['canal']) && empty($_GET['canal']) ){ | |
die('$_GET[canal] is empty'); | |
} |
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 | |
// Define path to application directory | |
defined('APPLICATION_PATH') | |
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); | |
// Define path to vendor directory | |
defined('VENDOR_PATH') | |
|| define('VENDOR_PATH', realpath(dirname(__FILE__) . '/../vendor')); |
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
[production] | |
oauth2_url = "https://accounts.google.com/o/oauth2" | |
api_url = "https://www.googleapis.com/oauth2/v1" | |
scope = "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email" | |
[staging : production] | |
[testing : production] | |
[development: production] |
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 | |
class AdminController extends Zend_Controller_Action | |
{ | |
public function init() | |
{ | |
$this->_googleConfig = Zend_Registry::get('google'); | |
$this->_model = new Application_Model_Manager(); | |
} |
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
#sudo apt-get install libxslt-dev libxml2-dev | |
#gem install nokogiri | |
#gem install capybara | |
# | |
#sudo apt-get install libqt4-dev | |
#sudo apt-get install g++ | |
# | |
#gem install poltergeist | |
# | |
#-------------------------------------------------------------------------------- |
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
require "sqlite3" | |
db = SQLite3::Database.new "logs.db" | |
db.execute "DROP TABLE IF EXISTS logs" | |
db.execute <<SQL | |
CREATE TABLE logs ( | |
project VARCHAR(100), | |
revision INT, | |
contributor VARCHAR(100), |
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
def mock_polymorphic | |
mock().tap do |p| | |
p.expects(:class).returns(p).at_least_once | |
p.expects(:base_class).returns(p).at_least_once | |
p.expects(:name).returns('Mock').at_least_once | |
p.expects(:id).returns((rand * 10e5).round).at_least_once | |
p.expects(:blank?).returns(false).at_least_once | |
p.expects(:destroyed?).returns(false).at_least_once | |
p.expects(:new_record?).returns(false).at_least_once | |
end |
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 Hash | |
def traverse *args | |
args.inject(self) { |h,k| h = h[k] } | |
end | |
end | |
h = { a: { b: { c: "foobar" } } } | |
h.traverse :a, :b, :c # "foobar" |
NewerOlder