Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rfsbsb's full-sized avatar

Rafael Silva rfsbsb

View GitHub Profile
<?php
class Node {
public $value;
public $next;
public function __construct($val) {
$this->value = $val;
}
@rfsbsb
rfsbsb / bitbucket-pipeline.yml
Created January 8, 2021 17:36 — forked from juniorb2ss/bitbucket-pipeline.yml
Bitbucket Pipeline Deploy Laravel to Elasticbeanstalk using parallel steps
image: atlassian/default-image:2
definitions:
services:
redis:
image: redis:3.2
memory: 512
mysql:
image: mysql:5.7
environment:
@rfsbsb
rfsbsb / movies.csv
Last active January 14, 2021 21:45
A list of movies
id year title
tt1711425 2013 21 & Over
tt1343727 2012 Dredd 3D
tt2024544 2013 12 Years a Slave
tt1272878 2013 2 Guns
tt0453562 2013 42
tt1335975 2013 47 Ronin
tt1606378 2013 A Good Day to Die Hard
tt2194499 2013 About Time
tt1814621 2013 Admission
@rfsbsb
rfsbsb / podcast-ratings.php
Last active February 20, 2017 17:24 — forked from sgmurphy/podcast-ratings.php
Scrape ratings from iTunes store
<?php
/*
* Get all reviews from iTunes store for a given podcast
*
*/
$podcast_id = '1204701206';
$countries = ['DZ', 'AO', 'AI', 'AG', 'AR', 'AM', 'AU', 'AT', 'AZ', 'BH', 'BB', 'BY', 'BE', 'BZ', 'BM', 'BO', 'BW', 'BR', 'VG', 'BN', 'BG', 'CA', 'KY', 'CL', 'CN', 'CO', 'CR', 'HR', 'CY', 'CZ', 'DK', 'DM', 'DO', 'EC', 'EG', 'SV', 'EE', 'FI', 'FR', 'DE', 'GH', 'GR', 'GD', 'GT', 'GY', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IE', 'IL', 'IT', 'JM', 'JP', 'JO', 'KZ', 'KE', 'KR', 'KW', 'LV', 'LB', 'LT', 'LU', 'MO', 'MK', 'MG', 'MY', 'ML', 'MT', 'MU', 'MX', 'MD', 'MS', 'NP', 'NL', 'NZ', 'NI', 'NE', 'NG', 'NO', 'OM', 'PK', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'QA', 'RO', 'RU', 'SA', 'SN', 'SG', 'SK', 'SI', 'ZA', 'ES', 'LK', 'KN', 'LC', 'VC', 'SR', 'SE', 'CH', 'TW', 'TZ', 'TH', 'BS', 'TT', 'TN', 'TR', 'TC', 'UG', 'GB', 'UA', 'AE', 'UY', 'US', 'UZ', 'VE', 'VN', 'YE'];
@rfsbsb
rfsbsb / aula1.txt
Created September 18, 2012 22:06
URLS da aula um
http://api.drupal.org
http://drupal.org/developing/modules
http://drupal.org/project/examples
http://drupal.org/coding-standards
http://drupal.org/writing-secure-code
http://api.drupal.org/api/search/7/%s
# versões do módulo
# Versão com um papel
@rfsbsb
rfsbsb / computedfield.php
Created August 21, 2012 20:44
Campo de preço por metro quadrado computado no Drupal
<?php
$area = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_area')));
$preco = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_preco')));
if ($preco > 0) {
$entity_field[0]['value'] = number_format(($preco / $area), 2, ',', '.');
} else {
$entity_field[0]['value'] = 0;
}