Skip to content

Instantly share code, notes, and snippets.

View gonzalovazquez's full-sized avatar
💭
Focusing on GraphQL

Gonzalo Vazquez gonzalovazquez

💭
Focusing on GraphQL
View GitHub Profile
@gonzalovazquez
gonzalovazquez / setting.json
Created April 29, 2020 17:42
VSCode Settings
{
"window.zoomLevel": 0,
"editor.renderWhitespace": "all",
"editor.tabSize": 2,
"git.autofetch": true,
"git.confirmSync": false,
"liveshare.featureSet": "stable",
"workbench.activityBar.visible": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"workbench.colorTheme": "Shades of Purple",
<script>
!function(n,o){o.forEach(function(o){n[o]||((n.__alloyNS=n.__alloyNS||
[]).push(o),n[o]=function(){var u=arguments;return new Promise(
function(i,l){n[o].q.push([i,l,u])})},n[o].q=[])})}
(window,["alloy"]);
</script>
@gonzalovazquez
gonzalovazquez / recommendation_engine.py
Created May 24, 2019 15:45
Recommendation Engine with Python
destinations = [
"Paris, France",
"Shanghai, China",
"Los Angeles, USA",
"São Paulo, Brazil",
"Cairo, Egypt"
]
attractions = [
[]
@gonzalovazquez
gonzalovazquez / connect_db_bq_example.py
Created March 17, 2019 05:59
Example read and write to BigQuery using Python
from google.cloud import bigquery
import datetime
def add_items_to_bigquery(name, description, in_cloud=True):
print("Adding items to BigQuery")
# Instantiates a client
bigquery_client = bigquery.Client()
# Prepares a reference to the dataset
dataset_ref = bigquery_client.dataset('universitas_library')
@gonzalovazquez
gonzalovazquez / background.js
Last active February 8, 2019 15:58
Chrome Extension - 2 way communication
'use strict';
function sendMessage() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, "Background page started.");
});
}
function update() {
console.log('update')
@gonzalovazquez
gonzalovazquez / ml-marketplace-data.json
Last active October 29, 2018 01:11
Structure for ML Marketplace Dataset Catalog
[
{
"id": 1234,
"name": "Fraud Detection",
"author": "Gonzalo Vazquez",
"description": "Lorem ipsum dolor sit amet",
"tags": ["crime", "finance"],
"info": {
"source": "fraud_detection.csv",
"size": "20mb",
@gonzalovazquez
gonzalovazquez / ml-marketplace-models.json
Last active October 29, 2018 00:50
Structure for ML Marketplace Model Catalog
[
{
"id": 1234,
"name": "Fraud Detection",
"author": "Gonzalo Vazquez",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tortor augue, efficitur a tempus quis, posuere nec orci. Sed sit amet leo a nisl pretium fringilla sit amet at neque. Vestibulum convallis mattis lectus. Etiam in semper orci. Curabitur in neque bibendum, aliquet lorem ac, tincidunt lectus. Maecenas posuere at neque quis vestibulum. Proin id efficitur ex, a rutrum nisl. Integer lorem ligula, tincidunt eu porttitor id, cursus at nisi. ",
"state": "Production",
"releasedVersions": "1.0.0",
"trainingFileList": "bla.txt",
"applicationsConnected": "Mobile Banking App",
@gonzalovazquez
gonzalovazquez / ss-routing.js
Created September 21, 2018 20:54
Server Side Routing in React
/**
* Async IIFE React
* Renders Spinner then tries to fetch routes from server.
* If routes are not available it renders application
* with default routes.
*/
(async () => {
ReactDOM.render(<ProgressBar />, elementMountPoint);
try {
const newContext = {
@gonzalovazquez
gonzalovazquez / programming-quotes.md
Created February 25, 2017 18:47 — forked from Potherca/README.md
Programming Quotes
source: http://quotes.cat-v.org/programming/

Programming Quotes

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.

        — C.A.R. Hoare, The 1980 ACM Turing Award Lecture

@gonzalovazquez
gonzalovazquez / redux-with-react.js
Created February 1, 2017 16:15
A simple store with ReactJS
// Reducer:
// Specifies how the next state
// is calculated based on the
// current state and the action
// being dispatched
const counter = (state = 0,
action) => {
switch (action.type) {
case 'INCREMENT':
return state + 1;