Skip to content

Instantly share code, notes, and snippets.

View vedovelli's full-sized avatar
💭
🚀

Fábio Vedovelli vedovelli

💭
🚀
View GitHub Profile
####
# ATENTION:
# Replace all occurences of sandbox with your project's name
####
# v2 syntax
version: '2'
# Named volumes
volumes:
@vedovelli
vedovelli / happy-number.js
Last active November 22, 2017 22:10
Happy number resolution
// http://dojopuzzles.com/problemas/exibe/numeros-felizes/
const numberToAssert = 7
//************************
let iterationLimit = 200
const assertHappiness = input => {

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@vedovelli
vedovelli / publication.json
Created October 14, 2016 14:49
Structure of a publication document
{
"raw_publ_no": "EP0758583A2",
"publ_no": "<a href=\"http://worldwide.espacenet.com/searchResults?DB=worldwide.espacenet.com&amp;locale=en_EP&amp;query=EP0758583A2&amp;ST=singleline&amp;compact=false\" target=\"_blank\">EP0758583A2</a>",
"title": "Laminated glass with infrared radiation reflecting properties",
"linked_title": "<a href=\"http://worldwide.espacenet.com/searchResults?DB=worldwide.espacenet.com&amp;locale=en_EP&amp;query=EP0758583A2&amp;ST=singleline&amp;compact=false\" target=\"_blank\">Laminated glass with infrared radiation reflecting properties<i class=\"fa fa-external-link\"></i></a>",
"priority_date": "1995-08-16",
"publ_date": "1997-02-19",
"abstract": "In a laminated glass pane comprising two glass sheets (1, 2) and a transparent support film (4) having an infra red reflecting surface coating (3), connected to the two glass sheets (1, 2) by adhesive layers (5, 6), the first adhesive layer (5) has a thickness of at most about 50 .mu.m. The second adhesive layer
$svg = "<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg version="1.1" style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Arial, Helvetica, sans-serif;font-size:12px;" xmlns="http://www.w3.org/2000/svg" width="600" height="400"><desc>Created with Highcharts 4.2.5</desc><defs><clipPath id="highcharts-1"><rect x="0" y="0" width="600" height="400"/></clipPath></defs><rect x="0" y="0" width="600" height="400" fill="#FFFFFF" class=" highcharts-background"/><g class="highcharts-series-group"><g class="highcharts-series highcharts-series-0 highcharts-tracker" transform="translate(10,10) scale(1 1)" style="cursor:pointer;"><path fill="rgb(218,40,28)" d="M 386.42117941589436 89.15410763569923 L 386.42117941589436 102.27910763569923 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(7,124,217)" d="M 374.5187008326802 295.1598928846466 L 374.5187008326802 308.2848928846466 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="
\DB::listen(function ($query) {
$fullQuery = vsprintf(str_replace(array('%', '?'), array('%%', '%s'), $query->sql), $query->bindings);
$logString = "Connection: {$query->connectionName}
Execution time: {$query->time}ms
Query: ${fullQuery}
---------------------" . PHP_EOL;
\Storage::append('logs/queries.log', $logString);
});
array:4 [
"index" => "startup"
"type" => "profile"
"size" => 32
"body" => array:1 [
"query" => array:1 [
"bool" => array:3 [
"must" => array:1 [
"match" => array:1 [
"full_description.english" => array:1 [
$hosts = ['http://octimine:ntQYnuLgeNBt24MMWryxRVdenupfUK44@188.40.136.133:9200'];
$client = \Elasticsearch\ClientBuilder::create()->setHosts($hosts)->build();
$parameters = [
'index' => 'startup',
'type' => 'profile',
'size' => 32,
'body' => [
'query' => [
'bool' => [
'must' => [
l5dbeka-mongo | 2016-09-21T16:50:45.046+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
l5dbeka-mongo | 2016-09-21T16:50:45.046+0000 W - [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.
l5dbeka-mongo | 2016-09-21T16:50:45.047+0000 W STORAGE [initandlisten] Recovering data from the last clean checkpoint.
l5dbeka-mongo | 2016-09-21T16:50:45.047+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
l5dbeka-mongo | 2016-09-21T16:50:50.673+0000 W STORAGE [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger
l5dbeka-mongo | 2016-09-21T16:50:50.6
# v2 sintax
version: '2'
# Named volumes
volumes:
# MySQL Data
l5dbeka-mysql-data:
driver: local
# Postgres Data