Skip to content

Instantly share code, notes, and snippets.

View TiuTalk's full-sized avatar
🌴
Tropical Developer

Thiago Belem TiuTalk

🌴
Tropical Developer
  • Assando Sites
  • Arraial d'Ajuda, BA - Brazil
  • 09:52 (UTC -03:00)
View GitHub Profile
/**
* 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();
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
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` (`
@zenorocha
zenorocha / Foca no código
Created August 27, 2012 14:42
Foca no código
/* Véi, foca no código
.---.
/o o\
__(= " =)__
//\'-=-'/\\
) (_
/ `"=-._
/ \ ``"=.
@netojoaobatista
netojoaobatista / Date.prototype.diff.js
Created April 26, 2012 20:09
Returns the difference between two Date objects.
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) {
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@TiuTalk
TiuTalk / gist:1021306
Created June 12, 2011 06:30
Install/update Apache 2, MySQL 5 and PHP 5
sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-mysql php-pear php5-suhosin