Skip to content

Instantly share code, notes, and snippets.

View AlexandreRoba's full-sized avatar

Alexandre Roba AlexandreRoba

View GitHub Profile
@AlexandreRoba
AlexandreRoba / AppWithConfig.scala
Last active April 22, 2021 06:54
Zio whit zio-config
package com.example
import zio._
import config._
import config.ConfigDescriptor._
import zio.blocking._
import zio.system._
import zio.config.typesafe.{ConfigDescriptorOps, TypesafeConfig}
import zio.console._
object AppReadingConfig extends App {
---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
name: hophopapi
namespace: hophop
annotations:
fluxcd.io/automated: "true"
filter.fluxcd.io/chart-image: glob:0.0.0-*
tag.fluxcd.io/app: image.tag
> $ helm list -n fluxcd
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
flux fluxcd 1 2020-05-28 23:51:05.841756 +0200 CEST deployed flux-1.3.0 1.19.0
helm-operator fluxcd 1 2020-05-29 00:10:04.202753 +0200 CEST deployed helm-operator-1.1.0 1.1.0
> $ helm list -n hophop
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
hophopapi hophop 146 2020-12-05 18:08:03.869615945 +0000 UTC deployed hophopapi-0.0.10 0.0.1
hophophome hophop 2 2020-09-04 14:08:09.749473228 +0000 UTC deployed hophophome-0.0.2 0.0.1
hophopwebadmin hophop 39 2020-12-07 15:37:08.512417026 +0000 UTC deployed hophopwebadmin-0.0.5 0.0.1
# Set variables in .bash_profile file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin

Keybase proof

I hereby claim:

  • I am alexandreroba on github.
  • I am alexandreroba (https://keybase.io/alexandreroba) on keybase.
  • I have a public key whose fingerprint is AAB6 3F61 E5D9 105E AEFA C419 8440 67ED 5C2B C060

To claim this, I am signing this object:

@AlexandreRoba
AlexandreRoba / gist:c47cff7e17bcf7b8a8206e536628dc71
Created September 15, 2016 12:23
Using the Google Place Autocomplete View Controller
void BtnNext_TouchUpInside(object sender, EventArgs e)
{
var FakeCoordinates = new CLLocationCoordinate2D()
{
Latitude = 54.135364,
Longitude = -0.797888
};
var north = LocationWithBearing(45, 3000, FakeCoordinates);
var east = LocationWithBearing(225, 3000, FakeCoordinates);
@AlexandreRoba
AlexandreRoba / gist:4885392198d949921e7ecd0b0f2c8e9e
Created September 7, 2016 13:07
SetVideoBackground Xamarin IOS
private void SetVideoBackground()
{
var asset = AVAsset.FromUrl(Foundation.NSUrl.FromFilename("BackgroundVideo.mp4"));
var playerItem = new AVPlayerItem(asset);
var player = new AVPlayer(playerItem);
var playerLayer = AVPlayerLayer.FromPlayer(player);
playerLayer.Frame = this.View.Frame;
playerLayer.VideoGravity = AVLayerVideoGravity.ResizeAspectFill;
playerLayer.ZPosition = -1;
this.View.Layer.AddSublayer(playerLayer);
@AlexandreRoba
AlexandreRoba / bootstrap.js
Created February 24, 2016 19:54 — forked from chrisjhoughton/bootstrap.js
SailsJS Geo-encoding and lookup
module.exports.bootstrap = function (cb) {
// Ensure we have 2dsphere index on Property so GeoSpatial queries can work!
sails.models.YOURMODEL.native(function (err, collection) {
collection.ensureIndex({ coordinates: '2dsphere' }, function () {
// It's very important to trigger this callack method when you are finished
// with the bootstrap! (otherwise your server will never lift, since it's waiting on the bootstrap)
cb();
@AlexandreRoba
AlexandreRoba / better-nodejs-require-paths.md
Created February 10, 2016 22:49 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions