Skip to content

Instantly share code, notes, and snippets.

View netrebel's full-sized avatar
🌴
Hacking away

Miguel Reyes netrebel

🌴
Hacking away
  • Life360
  • San Diego, CA
View GitHub Profile
@netrebel
netrebel / build.gradle
Created July 31, 2017 18:47
Gradle fatJar and ZIP (lambda)
apply plugin: 'java'
version = '1.0.0-SNAPSHOT'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
@netrebel
netrebel / neo4j-conf-sdn.java
Created August 11, 2017 14:39
MyNeo4jConfiguration
@EnableAutoConfiguration
@Configuration
@EnableTransactionManagement
@ComponentScan(basePackages = {"com.enernoc.yggi.neo4j.service"})
@EnableNeo4jRepositories(basePackages = "com.enernoc.yggi.neo4j.repository")
@EnableConfigurationProperties(ConfigProperties.class)
public class MyNeo4jConfiguration extends WebMvcConfigurerAdapter {
private static final Logger LOG = LoggerFactory.getLogger(MyNeo4jConfiguration.class);
@netrebel
netrebel / snsToSlack.js
Created August 21, 2017 20:42 — forked from tomfa/snsToSlack.js
AWS Lambda function SNS -> Slack Channel
var https = require('https');
var util = require('util');
var CHANNEL = "#aws-sns";
var PATH = "/services/your-slack-webhook-url-info-goes-here";
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
package main
import (
"fmt"
"net/http"
"sync"
"time"
)
type result struct {
@netrebel
netrebel / guestbook.yml
Created November 15, 2019 00:16
Kubernetes conf file
apiVersion: v1
kind: Service
metadata:
name: redis-master
labels:
app: redis
tier: backend
role: master
spec:
ports:
@netrebel
netrebel / simplejob.yaml
Created November 15, 2019 00:40
Kubernetes sample for simple job
apiVersion: batch/v1
kind: Job
metadata:
name: finalcountdown
spec:
template:
metadata:
name: finalcountdown
spec:
containers:
@netrebel
netrebel / cronjob.yaml
Created November 15, 2019 00:43
Kubernetes cronjob sample
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hellocron
spec:
schedule: "*/1 * * * *" #Runs every minute (cron syntax) or @hourly.
jobTemplate:
spec:
template:
spec: