Skip to content

Instantly share code, notes, and snippets.

View eugenehp's full-sized avatar
🔬
DeepTech, FinTech, BioTech, Robotics, SEO.

Eugene Hauptmann eugenehp

🔬
DeepTech, FinTech, BioTech, Robotics, SEO.
View GitHub Profile
@eugenehp
eugenehp / AndroidManifest.xml
Created April 19, 2021 16:08
Deep linking on Android
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.billingapp">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
@eugenehp
eugenehp / benchmark.ts
Created April 19, 2021 04:07
RNBenchmark
suite
.add('expo-random [Sync]', () => {
getRandomBytes(SIZE);
})
.add('expo-random [Async]', async () => {
await getRandomBytesAsync(SIZE);
})
.add('react-native-randomness', () => {
randomnessRandomBytes(SIZE);
})
@eugenehp
eugenehp / gatsby-config.js
Created April 12, 2021 00:24
gatsby-source-medium-backup integration
const markdownPages = `${__dirname}/src/markdown-pages`
module.exports = {
plugins: [
{
resolve: `gatsby-source-medium-backup`,
options: {
source: `${__dirname}/medium-export.zip`,
destination: markdownPages,
},
@eugenehp
eugenehp / json_endpoint.json
Created April 11, 2021 23:33
Unofficial Medium API endpoint
])
}while(1);</x>{
"success": true,
"payload": {
"user": {
"userId": "dc9e3fa402bd",
"name": "Eugene Hauptmann",
"username": "eugenehauptmann",
"createdAt": 1615565124899,
"imageId": "1*J0OI-J0hjTQ14-3JEzmgtw.jpeg",
@eugenehp
eugenehp / example.js
Created April 6, 2021 04:27
reddit question
// https://www.reddit.com/r/react/comments/mkuhg4/how_do_i_handle_this_i_want_to_set_state_on_lots/
const data = {
'loc': 'location',
'svc': 'serviceType',
'decorator': 'decorator',
...
};
const handleChange = (e) => {
@eugenehp
eugenehp / App.tsx
Created April 5, 2021 20:57
react-native-randomness example app
import * as React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { random } from 'react-native-randomness';
export default function App() {
const [result, setResult] = React.useState<any | undefined>();
React.useEffect(() => {
random().then(setResult);
@eugenehp
eugenehp / metro.config.js
Created April 5, 2021 20:54
react-native-randomness example metro config
const path = require('path');
const pak = require('../package.json');
const root = path.resolve(__dirname, '..');
const modules = Object.keys({
...pak.peerDependencies,
});
module.exports = {
@eugenehp
eugenehp / RandomnessModule.kt
Created April 5, 2021 20:44
react-native-randomness kotlin module
package com.reactnativerandomness
import android.util.Base64
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import java.security.SecureRandom
@eugenehp
eugenehp / RandomnessPackage.kt
Created April 5, 2021 20:42
react-native-randomness kotlin package
package com.reactnativerandomness
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
class RandomnessPackage : ReactPackage {
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
@eugenehp
eugenehp / Randomness.m
Created April 5, 2021 20:23
react-native-randomness Objective-C code
#import "Randomness.h"
@implementation Randomness
RCT_EXPORT_MODULE()
// Example method
// See // https://reactnative.dev/docs/native-modules-ios
RCT_REMAP_METHOD(random,
randomWithLength:(nonnull NSNumber*)length