Skip to content

Instantly share code, notes, and snippets.

View marcoslhc's full-sized avatar
🏳️‍🌈
He's like the rainbow

Marcos Hernández marcoslhc

🏳️‍🌈
He's like the rainbow
View GitHub Profile
@sbycrosz
sbycrosz / export-fastlane-match.rb
Created September 20, 2022 03:03
Export fastlane match signing credentials for AppCenter
# Export iOS code signing as p12 and mobileprovision file for usage in Appcenter
# Manual decryption as described on https://docs.fastlane.tools/actions/match/
desc "Export fastlane match signing credentials for AppCenter"
lane :export_code_signing do
ensure_env_vars(
env_vars: [
"MATCH_GIT_URL",
"MATCH_PASSWORD",
]
@rponte
rponte / git-revert-multiple-commits.sh
Created September 25, 2019 16:07
Git: reverting a range of commits
##
# Reverting a range of commits
#
# git --pretty=oneline --abbrev-commit older_commit..newer_commit # not includes the oldest commit
# git --pretty=oneline --abbrev-commit older_commit^..newer_commit # includes the oldest commit
##
# just to be sure about the commits, list them
git log --pretty=oneline --abbrev-commit 1f80548^..4b293d5
@JCMais
JCMais / react-native-svg.js
Last active August 1, 2023 00:12
React Native SVG mock to be used with jest, put in __mocks__ dir in the src dir.
// @flow
// https://github.com/FormidableLabs/react-native-svg-mock
import React from 'react';
const createComponent = function(name: string) {
return class extends React.Component {
// overwrite the displayName, since this is a class created dynamically
static displayName = name;
@ccnokes
ccnokes / axios-instance-config.js
Created July 6, 2017 16:23
Good default configuration for axios in node.js
const axios = require('axios');
const http = require('http');
const https = require('https');
module.exports = axios.create({
//60 sec timeout
timeout: 60000,
//keepAlive pools and reuses TCP connections, so it's faster
httpAgent: new http.Agent({ keepAlive: true }),
@douglascabral
douglascabral / kong
Last active July 30, 2018 20:20
Kong init.d
#!/bin/sh
#
# chkconfig: - 80 45
# description: Starts and stops Kong
# Enable: http://manpages.ubuntu.com/manpages/zesty/man8/update-rc.d.8.html
# update deamon path to point to the kong executable
start() {
echo -n "Starting Kong... "
kong start
@abhiaiyer91
abhiaiyer91 / reduxSelectorPattern.md
Last active April 29, 2022 06:00
Redux Selector Pattern

Redux Selector Pattern

Imagine we have a reducer to control a list of items:

function listOfItems(state: Array<Object> = [], action: Object = {}): Array<Object> {
  switch(action.type) {
    case 'SHOW_ALL_ITEMS':
      return action.data.items
    default:
@Avaq
Avaq / combinators.js
Last active May 1, 2024 09:38
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@jgilfelt
jgilfelt / CurlLoggingInterceptor.java
Created January 9, 2016 15:34
An OkHttp interceptor that logs requests as curl shell commands
/*
* Copyright (C) 2016 Jeff Gilfelt.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mbostock
mbostock / .gitignore
Last active December 25, 2015 18:38
New Splines!
.DS_Store
node_modules
@gaearon
gaearon / slim-redux.js
Last active April 25, 2024 18:19
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {