Skip to content

Instantly share code, notes, and snippets.

View vincicat's full-sized avatar

Vinci vincicat

View GitHub Profile
@vincicat
vincicat / Valheim_Decor_mod.md
Last active October 26, 2021 16:57
List of the intresting Valheim mod
@vincicat
vincicat / parse.js
Created October 24, 2021 20:24
parsing Unity YAML
// for js-yaml 4.0, to avoid unity "YAML unknown tag" error: schema is required
import yaml from "js-yaml";
import path from "path";
import fs, { readFileSync } from "fs";
function parseAssetFile(p, assetsPath) {
// Read the File
let file = fs.readFileSync(path.resolve(assetsPath, p), { encoding: "utf-8" });
// From github: https://github.com/nodeca/js-yaml/issues/100
@vincicat
vincicat / core.js
Created February 17, 2020 10:19
Example for crypto-js#259
/*globals window, global, require*/
/**
* CryptoJS core components.
*/
var CryptoJS = CryptoJS || (function (Math, undefined) {
var crypto;
// Native crypto from window (Browser)
@vincicat
vincicat / App.jsx
Created January 9, 2020 07:52
basic useContext()
import React from 'react';
import { AppProvider } from "./AppContext";
import { AppContainer } from "./AppContainer";
function App() {
return (
<AppProvider>
<AppContainer />
</AppProvider>
);
@vincicat
vincicat / react-hooks-memo.md
Last active January 8, 2020 13:04
memo: react hooks

The Basic

import

import React, {useEffect} from 'react';

Pick your hooks

useEffect

@vincicat
vincicat / apollo-undocumented.md
Last active January 14, 2020 03:08
Apollo client notes

Rendering Cycle

Every useQuery() will cause 3 renderings after mount:

  1. with cache-data (StatusCode 1)
  2. "now loading" (StatusCode 1)
  3. with data-result, or error (StatusCode 7)

If you need some prefetching, consider using useLazyQuery()

Cache

@vincicat
vincicat / random-markers.js
Created December 4, 2019 05:21
Generate Random Markers
function generateMarkers(fromCoordinate) {
const result = [];
const {latitude, longitude} = fromCoordinate;
for (let i = 0; i < 10; i++) {
let id = Math.ceil(Math.random() * 10000);
const newMarker = {
coordinate: {
latitude: latitude + (Math.random() - 0.5) * (LATITUDE_DELTA / 2),
longitude: longitude + (Math.random() - 0.5) * (LONGITUDE_DELTA / 2),
},
@vincicat
vincicat / Spinning.md
Created May 24, 2019 08:11
Spinning Unicode

#𒅒𒈔𒅒𒈔𒅒𒈔𒅒𒈔𒅒𒇫𒄆𒇫𒄆𒇫𒄆𒇫𒄆𒇫𒄆𒂝𒀱𒂝𒀱𒈔𒅒𒈔𒅒𒈔𒅒𒈔𒅒𒇫𒄆𒇫𒄆𒇫𒄆𒀱𒂝𒀱𒂝𒀱𒂝𒈔𒅒𒇫𒄆𒇫𒄆𒇫𒄆𒇫𒄆𒇫𒄆𒂝𒀱𒂝𒀱𒂝𒅒𒈔𒅒𒇫𒄆𒇫𒄆𒇫𒄆𒇫𒄆𒇫𒄆𒀱𒂝𒀱𒂝𒈔𒅒𒈔𒅒𒈔𒅒𒇫𒄆𒇫𒄆𒇫𒄆𒇫𒄆𒇫𒄆𒅒𒈔

Src

@vincicat
vincicat / README.md
Last active April 11, 2019 16:34
RN Missing Manual

RN Missing Manual (for 0.59)

No Expo

  • ...when you prefer native plugin, or move from older RN.

Choose your own navigation

  • navigation is the core of your app, choose wisely.

using cocoapod