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 / 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 / Dockerfile
Created Jan 8, 2019
Dockerfile template for Rails app
View Dockerfile
# Change Ruby version accordingly
FROM ruby:2.3-stretch
LABEL maintainer=""
RUN apt-get update
RUN apt-get install -y git
RUN mkdir /myapp
WORKDIR /myapp
caike /
Created Nov 18, 2018
solving raspberry.local issue

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 /
Last active Dec 28, 2017
Setting up ssh and wifi on first Raspbian Strech Lite boot
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[
%{"title" => "Elixir", "duration" => 123, "authors" => [
%{"name" => "José Valim"}
%{"title" => "JavaScript", "duration" => 666, "authors" => [
%{"name" => "Brendan Eich"}
caike /
Last active Sep 18, 2017 — forked from wmakley/
Install Ruby 1.8.7 on Mac OSX 10.12 Sierra with rbenv
# The main issues with Ruby 1.8.7 are that it won't build with Clang,
# and the Net::HTTPS module won't work with modern versions of OpenSSL.
# This assumes you have already set up homebrew, and run: xcode-select --install
#brew install homebrew/dupes/apple-gcc42
#brew install libyaml libffi
brew install
export CC=/usr/local/bin/gcc-4.2
View cart.exs
# from ounce of elixir
defmodule CartTest do
use ExUnit.Case
test "starts with empty count" do
assert Cart.count_items([]) == 0
caike / datetime.exs
Last active Aug 16, 2016
Elixir. Example of a function with a default argument value set to the current DateTime - calculated on runtime.
View datetime.exs
defmodule CreditCard do
def current_amount_due(charges, apr, due_date, current_date \\ date_now()) do
# then proceed with calculation..
defp date_now do
DateTime.utc_now |> DateTime.to_unix
caike / a-main.go
Last active Jul 22, 2016
Example of concurrency in Go with web requests to Express
View a-main.go
package main
import (
func main() {
connections := lib.GetAllConnections()
var wg sync.WaitGroup
caike / main.go
Created May 24, 2016
Parallel example
View main.go
package main
import (
func main() {
You can’t perform that action at this time.