Skip to content

Instantly share code, notes, and snippets.

View germanattanasio's full-sized avatar
🇦🇷
Learning

German Attanasio germanattanasio

🇦🇷
Learning
View GitHub Profile
@ammardodin
ammardodin / createClassifierByteArray.js
Last active February 23, 2018 01:00
Use a UInt8Array with createClassifier
var VisualRecognitionV3 = require('watson-developer-cloud/visual-recognition/v3');
var toBuffer = require('typedarray-to-buffer')
var visualRecognition = new VisualRecognitionV3({
api_key: 'INSERT YOUR API KEY HERE',
version: '2016-05-20'
});
var catClassImages = toBuffer(<YOUR_BYTE_ARRAY>);
var dogClassImages = toBuffer(<YOUR_BYTE_ARRAY>);
@bisubus
bisubus / ES5-ES6-ES2017-ES2019 omit & pick
Last active April 13, 2024 21:03
ES5/ES6/ES2017/ES2019 omit & pick
@germanattanasio
germanattanasio / .jslintrc
Created April 11, 2015 03:29
JSHint configuration for node development
{
"globals": {
"jasmine": false,
"spyOn": false,
"it": false,
"console": false,
"describe": true,
"expect": false,
"beforeEach": false,
"before": false,
@nkbt
nkbt / .eslintrc.js
Last active May 5, 2024 07:31
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@loeschg
loeschg / DateTypeAdapter.java
Last active December 11, 2019 12:14
Custom TypeAdapter for GSON which handles both Date and DateTime formats (ISO 8601 and a simple date format)
package com.my.utility;
import com.fasterxml.jackson.databind.util.ISO8601Utils;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.text.DateFormat;
package org.paulbetts.shroom.core;
import android.os.AsyncTask;
import com.squareup.okhttp.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@delor
delor / mvn-output
Last active February 7, 2018 09:41
Minimal Maven configuration separating unit and integration tests.
$ mvn verify
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-tests-config 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ maven-tests-config ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
@davemo
davemo / api.proxy.server.js
Created November 6, 2012 21:56
A simple express.js server with a proxy that intercepts all requests with /api/ and proxies them to localhost:3000
var express = require('express'),
httpProxy = require('http-proxy'),
app = express();
var proxy = new httpProxy.RoutingProxy();
function apiProxy(host, port) {
return function(req, res, next) {
if(req.url.match(new RegExp('^\/api\/'))) {
proxy.proxyRequest(req, res, {host: host, port: port});