Skip to content

Instantly share code, notes, and snippets.

View devfelipereis's full-sized avatar

Felipe Gonçalves dos Reis devfelipereis

View GitHub Profile
@nashfive
nashfive / hexStringToUint16.dart
Created December 10, 2019 14:14
Convert a hexadecimal string to a Uint16
import 'dart:typed_data';
/// Converts [input] to a Uint16.
///
/// For example, _decodeToUint16("734c") slices [input] into 2 substrings
/// of 2 hexa characters ('73' and '4c') and create a Uint8 list from their
/// respective decimal representation (i.e. [115, 76]).
///
/// Finally, it returns an unsigned 16-bits integer representation (little endian)
/// by using a [ByteData] view (i.e. '19571').
# Get the K8S_URL and Token from Rancher Cluster level Kubeconfig (logged in as the CI user)
export K8S_URL=https://<rancherurl>/k8s/clusters/<clusterid>
export TOKEN=<RANCHERTOKEN>
export NAMESPACE=<kubernetes-namespace>
# Typically these are identical. Check from the YAML file of your deployment.
export DEPLOYMENT=<deployment-name>
export CONTAINER=<container-name>
# The docker-image-version must be updated every time you built a new container.
@bvis
bvis / README.md
Last active April 12, 2024 04:21
Docker Env Vars expanded with secrets content

Variables by Secrets

Sample script that allows you to define as environment variables the name of the docker secret that contains the secret value. It will be in charge of analyze all the environment variables searching for the placeholder to substitute the variable value by the secret.

Usage

You can define the next environment variables:

@lopspower
lopspower / README.md
Last active July 20, 2024 20:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@chantastic
chantastic / on-jsx.markdown
Last active May 30, 2024 13:11
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@mraleph
mraleph / writer.dart
Last active March 9, 2021 17:02
manual big endian conversion in Dart
library writer;
import 'dart:typed_data';
/// Writer wraps a fixed size Uint8List and writes values into it using
/// big-endian byte order.
class Writer {
/// Output buffer.
final Uint8List out;
@josephspurrier
josephspurrier / values_pointers.go
Last active July 15, 2024 16:04
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing