Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-mysql php-pear php5-suhosin |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Object.defineProperty(Date.prototype,"diff",{ | |
writable: false, configurable: false, enumerable: true, | |
/** | |
* Returns the difference between two Date objects. | |
* @param {Date} The date to compare to. | |
* @return {Object} | |
* @throws {TypeError} | |
*/ | |
value: function(date) { |
/* Véi, foca no código | |
.---. | |
/o o\ | |
__(= " =)__ | |
//\'-=-'/\\ | |
) (_ | |
/ `"=-._ | |
/ \ ``"=. |
INSERT INTO `states` (`id`, `name`, `code`) VALUES (1, 'Acre', 'AC'); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Acrelândia', -9.825808, -66.897166); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Assis Brasil', -10.929765, -69.573794); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Brasiléia', -10.994994, -68.749696); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Bujari', -9.815277, -67.955029); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Capixaba', -10.566031, -67.686006); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Cruzeiro do Sul', -7.627625, -72.675582); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Epitaciolândia', -11.018771, -68.734109); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Feijó', -8.170536, -70.350973); | |
INSERT INTO `cities` (` |
outdated_gems = `gem outdated` | |
regex = %r((?<gem>[\w-]+) \((?<old>[\d\.]+) < (?<new>[\d\.]+)\)) | |
gemfile = File.read("./Gemfile") | |
outdated_gems.each_line do |line| | |
data = line.match(regex) | |
gemfile.gsub!(%r(gem '#{data[:gem]}',(\s+)'[^']+'), "gem '#{data[:gem]}',\\1'#{data[:new]}'") | |
end |
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |