Skip to content

Instantly share code, notes, and snippets.

View jneuendorf's full-sized avatar

Jim jneuendorf

  • I4H Technologies UG
  • Berlin, Germany
View GitHub Profile
@jneuendorf
jneuendorf / clean.sh
Last active October 16, 2024 18:59
clean macOS files from external drive
#!/bin/bash
# Path to the external drive
EXTERNAL_DRIVE="$1"
# Remove .DS_Store, .Trashes, and Icon files
find "$EXTERNAL_DRIVE" -name ".DS_Store" -delete
find "$EXTERNAL_DRIVE" -name "Icon\r" -delete
find "$EXTERNAL_DRIVE" -name ".Trashes" -exec rm -rf {} +
@jneuendorf
jneuendorf / app-icons.js
Created June 4, 2018 10:36
Load vector icons as sourceMap in React Native
// Define all your icons once,
// load them once,
// and use everywhere
import Ionicons from 'react-native-vector-icons/Ionicons';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
// define your suffixes by yourself..
// here we use active, big, small, very-big..
const replaceSuffixPattern = /--(active|big|small|very-big)/g;
@jneuendorf
jneuendorf / ConvertibleReactComponent.js
Last active August 21, 2017 21:50
A React component that can more easily be converted between a functional and class component than a React.Component during development
class ConvertibleComponent extends React.Component {
render() {
return this[this.constructor.name](this.props);
}
}
// Lets say you have a component whose final code you aren't certain about yet.
// 1. as functional component:
function MyComponent(props) {