Skip to content

Instantly share code, notes, and snippets.

Carlos Souza caike

Block or report user

Report or block caike

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@caike
caike / dope-flan.md
Created Apr 20, 2020
Dope Brazilian Flan
View dope-flan.md
  • 3 eggs
  • 1 yolk
  • 2 cans of sweetened condensed milk
  • One of these ☝️ empty cans full of whole milk
  • A pinch of vanilla extract
@caike
caike / ec2-nginx.yml
Last active Apr 27, 2020
CloudFormation templates. Must use Linux 2 AMI images because of systemd.
View ec2-nginx.yml
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Creates an EC2 instance with Nginx installed and running.'
Parameters:
VPC:
Description: VPC for the SecurityGroup
Type: AWS::EC2::VPC::Id
@caike
caike / timer.js
Last active Oct 1, 2019
Example of updating timer on the fly
View timer.js
$(function() {
const timer = $('.timer');
timer.startTimer({ allowPause: true });
setTimeout(() => {
timer.trigger('click');
timer.data('timeLeft', 30);
timer.trigger('click');
}, 3000);
});
@caike
caike / main.go
Created Aug 22, 2019
Go web server example with support for URL matching on regular expressions
View main.go
package main
import (
"net/http"
"regexp"
)
type route struct {
pattern *regexp.Regexp
handler http.Handler
@caike
caike / fifa-world-cup-winners.json
Last active Aug 21, 2019
List of FIFA World Cup winners
View fifa-world-cup-winners.json
[
{ "country": "France", "year": 2018 },
{ "country": "Germany", "year": 2014 },
{ "country": "Spain", "year": 2010 },
{ "country": "Italy", "year": 2006 },
{ "country": "Brazil", "year": 2002 },
{ "country": "France", "year": 1998 },
{ "country": "Brazil", "year": 1994 },
{ "country": "West Germany", "year": 1990 },
{ "country": "Argentina", "year": 1986 },
@caike
caike / hoc-demo.js
Created May 9, 2019
Higher Order Component demo
View hoc-demo.js
function App(props){
return `Message ${props.classes.button} ${props.classes.isActive}`;
}
const styles = {
button: "btn-primary",
isActive: "is-active"
};
const styledProps = withStyles(styles);
@caike
caike / Dockerfile
Created Jan 8, 2019
Dockerfile template for Rails app
View Dockerfile
# Change Ruby version accordingly
FROM ruby:2.3-stretch
LABEL maintainer="carloshrsouza@gmail.com"
RUN apt-get update
RUN apt-get install -y git
RUN mkdir /myapp
WORKDIR /myapp
@caike
caike / issue.md
Created Nov 18, 2018
solving raspberry.local issue
View issue.md

Found this solution to address the problem where raspberry.local can't be found on the network. Run:

dscacheutil -q host -a name raspberrypi.local

Then try it again shrug

@caike
caike / attempt-to-increase-performance.md
Last active Dec 28, 2017
Setting up ssh and wifi on first Raspbian Strech Lite boot
View attempt-to-increase-performance.md
@caike
caike / a-seeds.exs
Last active Sep 13, 2017
creating nested records with cast_assoc in Phoenix
View a-seeds.exs
# In this example, Video has_many authors.
# Here is the code for creating a video with authors
# using a single call to Repo.insert
Enum.map([
%{"title" => "Elixir", "duration" => 123, "authors" => [
%{"name" => "José Valim"}
]
},
%{"title" => "JavaScript", "duration" => 666, "authors" => [
%{"name" => "Brendan Eich"}
You can’t perform that action at this time.