Skip to content

Instantly share code, notes, and snippets.

View GantMan's full-sized avatar
🤖
Being a Machine Learning beast

Gant Laborde GantMan

🤖
Being a Machine Learning beast
View GitHub Profile
// Load files from the server to the client!
const model = await nsfwjs.load('/model/')
@GantMan
GantMan / nsfwjs import.js
Created February 18, 2019 19:39
How to import a file
// Classic import style
import * as nsfwjs from 'nsfwjs'
// or just use require('nsfwjs')
@GantMan
GantMan / Convert.md
Last active September 21, 2019 00:58
Converting Machine Learning Models
@GantMan
GantMan / Terrible fix
Created January 22, 2019 06:07
Copy over your yarn lock contents with this junk. Then do a fresh `yarn` to re-lock with package.json contents
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.35":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8"
dependencies:
"@babel/highlight" "^7.0.0"
@GantMan
GantMan / Welcome.js
Created November 14, 2018 20:50
No native - this is a simple non-native solution for welcome
import React from "react"
import { Text } from "react-native"
export default (props) =>
<Text {...props}>
{props.text ? `WELCOME ${props.text.toUpperCase()}!` : 'WELCOME!'}
</Text>
@GantMan
GantMan / WelcomeNative.js
Last active November 8, 2018 18:31
How to simply load a React Native custom managed view from JS
import { requireNativeComponent } from 'react-native';
export default requireNativeComponent('RNTWelcomeView');
@GantMan
GantMan / RNTWelcomeViewManager.java
Last active November 8, 2018 18:17
Simple Welcome component in Java
package com.diveintonative;
import android.widget.TextView;
import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
public class RNTWelcomeViewManager extends SimpleViewManager<TextView> {
public static final String REACT_CLASS = "RNTWelcomeView";
@GantMan
GantMan / RNTWelcomeViewManager.m
Last active November 8, 2018 16:40
Adding custom view property
RCT_CUSTOM_VIEW_PROPERTY(text, NSString, __unused UILabel)
{
view.text = [NSString stringWithFormat:@"WELCOME %@!", [json uppercaseString]];
}
@GantMan
GantMan / RNTWelcomeViewManager.m
Last active November 8, 2018 16:33
Basic Welcome View Manager for React Native
#import "RNTWelcomeViewManager.h"
@implementation RNTWelcomeViewManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
UILabel *myTextView = [UILabel new];
myTextView.text = @"WELCOME!";
return myTextView;
@GantMan
GantMan / Fastfile
Last active October 5, 2018 17:09
Latest version of fastlane has new commands for my blog post on simple react native ios releases
default_platform(:ios)
platform :ios do
desc "Push a new beta build to TestFlight"
desc "This will also make sure the profile is up to date"
lane :beta do
# UI.important "Important Message"
# UI.error "O NO!"
# UI.message "Basic blah"