Skip to content

Instantly share code, notes, and snippets.

View JCMais's full-sized avatar
🚀
Being Happy

Jonathan Cardoso JCMais

🚀
Being Happy
View GitHub Profile
@JCMais
JCMais / k8s-cluster.json
Created January 4, 2019 13:01
Grafana dashboards from kubernetes app but using prometheus metrics instead of the datasource from the plugin
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@JCMais
JCMais / .zshrc
Last active March 11, 2019 14:38
I will use this keep notes of stuff I keep forgetting, and some aliases I use
### Just some aliases that can be added to your source
### some k8s ones were copied from https://gist.github.com/tuannvm/04487aec37d2056d8a4b4c4b9d53dd16#file-k8s-bashrc
# Get resources
# kget <pod|deployment|svc> <resource-name> <option>
kget() {
kubectl get $@
}
# Change context
// eslint-disable-next-line import/no-extraneous-dependencies
const NodeEnvironment = require('jest-environment-node');
const MongodbMemoryServer = require('mongodb-memory-server');
class MongoDbEnvironment extends NodeEnvironment {
constructor(config) {
super(config);
// eslint-disable-next-line new-cap
this.mongod = new MongodbMemoryServer.default({
instance: {
@JCMais
JCMais / MutationUtils.js
Created March 20, 2018 18:07 — forked from sibelius/MutationUtils.js
Helper methods for Relay Modern updater
// @flow
import { ConnectionHandler } from 'relay-runtime';
import { isObject, isArray } from 'lodash/fp';
export function listRecordRemoveUpdater({ parentId, itemId, parentFieldName, store }) {
const parentProxy = store.get(parentId);
const items = parentProxy.getLinkedRecords(parentFieldName);
parentProxy.setLinkedRecords(items.filter(record => record._dataID !== itemId), parentFieldName);
}
@JCMais
JCMais / MutationUtils.js
Created March 20, 2018 18:07 — forked from sibelius/MutationUtils.js
Helper methods for Relay Modern updater
// @flow
import { ConnectionHandler } from 'relay-runtime';
import { isObject, isArray } from 'lodash/fp';
export function listRecordRemoveUpdater({ parentId, itemId, parentFieldName, store }) {
const parentProxy = store.get(parentId);
const items = parentProxy.getLinkedRecords(parentFieldName);
parentProxy.setLinkedRecords(items.filter(record => record._dataID !== itemId), parentFieldName);
}
// @flow
type User = {
id: string,
name: string,
tags: Tag[],
}
@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;
@JCMais
JCMais / watchman.js
Created August 4, 2017 14:11
Fixing https://github.com/facebook/watchman/issues/479, edit jest-haste-map/build/crawlers/watchman.js
'use strict'; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
@JCMais
JCMais / learning.md
Last active April 26, 2017 01:20 — forked from sibelius/learning.md
Learning Path React Native

Basics

  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
  • Learn how to use fetch to get data from your backend

Learn Navigation

{
"tools":{
"axe" : {
"toollist": [
"abyssalcraft:aaxe",
"abyssalcraft:coraxe",
"abyssalcraft:dreadiumaxe",
"abyssalcraft:daxe",
"abyssalcraft:daxe",
"abyssalcraft:ethaxiumaxe",