Skip to content

Instantly share code, notes, and snippets.

View raaims's full-sized avatar

Raims Cabrera raaims

View GitHub Profile
@raaims
raaims / README.md
Created February 24, 2020 02:59
Mistel Barocco keymap

Layer 1

  • left-space acts as fn
  • backtick on press, esc on fn+backtick

Layer 2 ("visitor mode")

Use this when using other computers. Be sure to turn on dvorak mode (left-space + a).

  • left-space acts as fn
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@elderbas
elderbas / class_controller.ex
Last active April 5, 2024 03:35
Elixir — Inserting Multiple Changesets Into Database - create batch
def create_batch(conn, %{"people" => people_params}) do
changesets = Enum.map(people_params, fn class ->
Person.changeset(%Person{}, person)
end)
result = changesets
|> Enum.with_index()
|> Enum.reduce(Ecto.Multi.new(), fn ({changeset, index}, multi) ->
Ecto.Multi.insert(multi, Integer.to_string(index), changeset)
end)
@mbenatti
mbenatti / 0-font-awesome-bootstap-phoenix.md
Last active February 2, 2024 14:59
Installing Bootstrap 4 + Font Awesome from NPM in Phoenix Framework using sass
  • Tested with Phoenix 1.3

1) Installing sass, font-awesome and bootstrap package's using Brunch

First, install the Sass, Font Awesome, bootstrap(and deps) package:

cd assets

  • npm install --save-dev sass-brunch
  • npm install --save font-awesome
@kipcole9
kipcole9 / Map.Helpers
Last active October 24, 2023 22:13
Helpers for Elixir Maps: underscore, atomise and stringify map keys
defmodule Map.Helpers do
@moduledoc """
Functions to transform maps
"""
@doc """
Convert map string camelCase keys to underscore_keys
"""
def underscore_keys(nil), do: nil
@robinmonjo
robinmonjo / es6-higher-order-component.md
Last active March 14, 2019 17:27
ES6 Higher Order Components

Redux higher order components

Sometimes we need to share props and behaviour between multiple components/containers. For that we can do a higher order component. Example:

Decorator component

Higher Order Component that will decorate other component:

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 1, 2024 17:49
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites