Skip to content

Instantly share code, notes, and snippets.

View lnfnunes's full-sized avatar
👽

Leandro Nunes lnfnunes

👽
View GitHub Profile
@peterlazar1993
peterlazar1993 / layoutAnimationConfig.js
Created December 8, 2017 07:42
layoutAnimationConfig
export const configLayoutAnimation = () =>
Platform.OS === 'ios'
? LayoutAnimation.easeInEaseOut()
: LayoutAnimation.configureNext({
duration: 300,
create: {
type: LayoutAnimation.Types.easeInEaseOut,
property: LayoutAnimation.Properties.opacity,
},
update: { type: LayoutAnimation.Types.easeInEaseOut },
@nicolastakashi
nicolastakashi / calculadora_irpf.ex
Last active March 7, 2018 00:55
Função para calcular imposto de renda pessoa fisica em elixir.
defmodule CalculadoraImpostoRenda do
@moduledoc """
Fornece uma função `calcular/1` para calcular o valor de imposto a ser pago com base no salário informado
"""
@doc """
Calcula o valor de imposto de renda que deve ser pago com base em um salário
## Parameters
- Salario: Valor do salário que deseja saber o valor do IRPF.
@rbsilva
rbsilva / blank_vhd.py
Last active August 7, 2017 13:09 — forked from sedouard/blank_vhd.py
Create Blank VHD for Microsoft Azure
import datetime
import uuid
from azure.storage.blob import PageBlobService as BlobService
def generate_vhd_footer(size):
# Fixed VHD Footer Format Specification
# spec: https://technet.microsoft.com/en-us/virtualization/bb676673.aspx#E3B
# Field Size (bytes)
# Cookie 8
# Features 4
@patrinhani-ciandt
patrinhani-ciandt / check-load-polyfills.js
Last active March 10, 2017 02:21
Javascript Helper to turn easy to load a polyfill library just if necessary
/*
Usage Example:
window.PolyfillHelpers.loadPolyfillLib(
// Callback condition that says if the polyfill need to be loaded or not
function () { return ('Promise' in window); },
// Polyfill lib path
'/bower_components/es6-promise/es6-promise.auto.min.js', { async: false },
// Polyfill check/load completed
function(polyfillUsed) {
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@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

@hdragomir
hdragomir / index.html
Created July 7, 2014 09:48
IIFE version of SM Font Loading
<script type="text/javascript">
(function (css_href) {
"use strict";
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
} else if (el.attachEvent) {
el.attachEvent("on" + ev, callback);
@rxaviers
rxaviers / gist:7360908
Last active July 27, 2024 17:59
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@zenorocha
zenorocha / .hyper.js
Last active November 12, 2023 15:13 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");