Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Being Happy

Jonathan Cardoso JCMais

🚀
Being Happy
View GitHub Profile
@JCMais
JCMais / k8s-cluster.json
Created Jan 4, 2019
Grafana dashboards from kubernetes app but using prometheus metrics instead of the datasource from the plugin
View k8s-cluster.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@JCMais
JCMais / .zshrc
Last active Mar 11, 2019
I will use this keep notes of stuff I keep forgetting, and some aliases I use
View .zshrc
### 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
View mongodb.js
// 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 Mar 20, 2018 — forked from sibelius/MutationUtils.js
Helper methods for Relay Modern updater
View MutationUtils.js
// @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 Mar 20, 2018 — forked from sibelius/MutationUtils.js
Helper methods for Relay Modern updater
View MutationUtils.js
// @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);
}
View User.js
// @flow
type User = {
id: string,
name: string,
tags: Tag[],
}
@JCMais
JCMais / react-native-svg.js
Last active Aug 26, 2020
React Native SVG mock to be used with jest, put in __mocks__ dir in the src dir.
View react-native-svg.js
// @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 Aug 4, 2017
Fixing https://github.com/facebook/watchman/issues/479, edit jest-haste-map/build/crawlers/watchman.js
View 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 Apr 26, 2017 — forked from sibelius/learning.md
Learning Path React Native
View learning.md

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

View tools-and-blocks.json
{
"tools":{
"axe" : {
"toollist": [
"abyssalcraft:aaxe",
"abyssalcraft:coraxe",
"abyssalcraft:dreadiumaxe",
"abyssalcraft:daxe",
"abyssalcraft:daxe",
"abyssalcraft:ethaxiumaxe",
You can’t perform that action at this time.