This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!bin/sh | |
| # Update installed packages and package cache | |
| sudo yum update -y | |
| # make sure in the home folder | |
| cd ~/ | |
| # Golang installation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Copyright 2017 Théo Chamley | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| # this software and associated documentation files (the "Software"), to deal in the Software | |
| # without restriction, including without limitation the rights to use, copy, modify, merge, | |
| # publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons | |
| # to whom the Software is furnished to do so, subject to the following conditions: | |
| # | |
| # The above copyright notice and this permission notice shall be included in all copies or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| machine: | |
| pre: | |
| - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 | |
| services: | |
| - docker | |
| dependencies: | |
| override: | |
| - sudo pip install --upgrade docker-compose | |
| - docker build --rm=false -t project/image:ci . | |
| database: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| machine: | |
| pre: | |
| - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 | |
| services: | |
| - docker | |
| dependencies: | |
| override: | |
| - sudo pip install --upgrade docker-compose | |
| - docker build --rm=false -t project/image:ci . | |
| database: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| feature_tests: | |
| image: project/image:ci | |
| container_name: features_tests | |
| command: bash -c "service postgresql start; sleep 1m; xvfb-run -a rspec spec/features" | |
| controller_tests: | |
| image: project/image:ci | |
| container_name: controller_tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: ingress-tutorial | |
| annotations: | |
| nginx.ingress.kubernetes.io/rewrite-target: / | |
| spec: | |
| backend: | |
| serviceName: default-http-backend | |
| servicePort: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: simple-auth-ingress | |
| spec: | |
| backend: | |
| serviceName: default-http-backend | |
| servicePort: 80 | |
| rules: | |
| - host: simple-auth.me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "http/client" | |
| require "./simple-auth/*" | |
| module Simple::Auth | |
| macro default_layout_view_for(view) | |
| render "src/views/#{{{view}}}.ecr", "src/views/layouts/default.ecr" | |
| end | |
| get "/" do | |
| default_layout_view_for "index" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| applications: | |
| - path: . | |
| memory: 256M | |
| instances: 1 | |
| domain: eu-gb.mybluemix.net | |
| name: bluemix-blog | |
| host: bluemix-blog | |
| disk_quota: 1024M | |
| command: rake db:migrate && bin/rails server -p $PORT -e $RAILS_ENV | |
| services: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| topic := "topic-to-subscribe-to" //e.g. user-created-topic | |
| partitionList := consumer.Partitions(topic) //get all partitions | |
| messages := make(chan *sarama.ConsumerMessage, 256) | |
| initialOffset := sarama.OffsetOldest //offset to start reading message from | |
| for _, partition := range partitionList { | |
| pc, _ := consumer.ConsumePartition(topic, partition, initialOffset) | |
| go func(pc sarama.PartitionConsumer) { | |
| for message := range pc.Messages() { | |
| messages <- message //or call a function that writes to disk | |
| } |