Skip to content

Instantly share code, notes, and snippets.

View kevinmmartins's full-sized avatar

Kevin Martins kevinmmartins

View GitHub Profile
@kevinmmartins
kevinmmartins / .arduino-travis.yml
Last active April 5, 2019 17:39
Travis CI to Arduino Uno
language: c
sudo: false
before_install:
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
install:
- sudo apt-get install -qq gcc-avr binutils-avr avr-libc
- arduino --install-library "aREST"
script:
- build_platform uno
notifications:
#include <SPI.h>
#include <Ethernet.h>
#include <aREST.h>
#include <avr/wdt.h>
const int RAIN_D = 2; //Used to get rain sensor information
const int RAIN_A = A5; //Used to get rain sensor information
const String DIGITAL_MESSAGE_VALUE = "Digital value : ";
const String ANALOGIC_MESSAGE_VALUE = "Analogic value: ";
int digitalValue = 0;
@kevinmmartins
kevinmmartins / ChartJSDrillDown.js
Last active April 5, 2019 17:36
ChartJS - Show chart data when click
var myNewChart;
var data = {
datasets: [{
data: [300, 50, 100],
backgroundColor: [
"#F7464A",
"#46BFBD",
"#FDB45C"
]
@kevinmmartins
kevinmmartins / route.xml
Created June 24, 2018 23:00
Camel - Set HTTP Pool
<!-- Create the HTTP pool -->
<bean id="http" class="org.apache.camel.component.http.HttpComponent">
<property name="camelContext" ref="camel" />
<property name="httpConnectionManager" ref="myHttpConnectionManager" />
</bean>
@kevinmmartins
kevinmmartins / Convert-JAR-To-Bundle.md
Last active March 4, 2019 17:52
Servicemix - Convert jar into bundle

Convert a JAR to bundle

Run command

./bin/servicemix

Linux

@kevinmmartins
kevinmmartins / LdapConnection.java
Created July 18, 2018 18:39
Class to Authenticate a user in LDAP
package com.test.ldap;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
public class LdapConnection {
@kevinmmartins
kevinmmartins / cloudformation-spring-dynamo-beanstalk.json
Last active March 4, 2019 17:53
Cloudformation to a Java application using Beanstalk and DynamoDB
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"ApplicationBucket": {
"Type": "String",
"Description": "The bucket name with artifact"
},
"ApiKey": {
"Type": "String",
"Description": "The API key to make requests to server"
@kevinmmartins
kevinmmartins / cloudformation-beanstalk-cloudfront.json
Last active March 4, 2019 17:52
Cloudformation with Beanstalk and CloudFront
{
"AWSTemplateFormatVersion":"2010-09-09",
"Metadata":{
"AWS::CloudFormation::Interface":{
"ParameterGroups":[
{
"Label":{
"default":"Application version"
},
"Parameters":[
@kevinmmartins
kevinmmartins / docker-compose-node-mongo.yml
Created October 28, 2018 15:39
Docker compose to a Node application with MongoDB
services:
thing-provider-service:
image: node
working_dir: /usr/src/app
volumes:
- ./:/usr/src/app
command: bash -c "npm install && npm start"
ports:
- "3002:3002"
depends_on:
@kevinmmartins
kevinmmartins / Install-sqlacodegen.md
Last active November 8, 2018 11:52
Generate SQLAlchemy Models from Postgres using sqlacodegen

Install

pip install sqlacodegen

Error with psycopg2

If you have the problem: