Skip to content

Instantly share code, notes, and snippets.

@Eldelshell
Eldelshell / MainActivity.java
Created December 26, 2016 22:31
Receive input from Android apps on your React Native (0.39) application
package com.myapp;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
// Standard Activiy generated by react-native
public class MainActivity extends ReactActivity {
@Eldelshell
Eldelshell / Donut.js
Last active January 11, 2017 18:36
React Native Pie Chart
import React, { PropTypes } from 'react';
import { View, Platform } from 'react-native';
import { Surface, Shape, Path, Group } from 'ReactNativeART';
/**
* Custom implementation of the react-native-circular-progress that allows to
* render ART donut charts. Instead of accepting a single set of fill & color values,
* this components takes an array of objects.
* https://github.com/bgryszko/react-native-circular-progress
* @example
@Eldelshell
Eldelshell / 00-Istio-Certificates.md
Last active April 2, 2020 10:41
Istio Certificates Wizard

Certificate Wizard

Generates a bunch of files needed for securing SSL/TLS servers.

Istio

To add this files to Istio:

$ oc create -n istio-system secret tls ingressgateway-EXAMPLE-certs --key EXAMPLE-root.key --cert EXAMPLE-root.crt
@Eldelshell
Eldelshell / AESCrypto.java
Last active October 21, 2020 08:15
Encrypt & decrypt Java String
import java.security.Key;
import java.util.Optional;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class AESCrypto {
public Optional<String> encrypt (final String plain, final String secret) {
Key aesKey = new SecretKeySpec(secret.getBytes(), "AES");
package com.example;
/*
* Copyright (C) 2014 Alejandro Ayuso
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of