Skip to content

Instantly share code, notes, and snippets.

View janziemba's full-sized avatar
✌️
🇺🇦🇨🇿

Jan Ziemba janziemba

✌️
🇺🇦🇨🇿
View GitHub Profile
@janziemba
janziemba / .github-workflows-main.yml
Created February 27, 2020 14:20 — forked from edvinasbartkus/.github-workflows-main.yml
Github Action for React Native Detox
name: Detox
on: [push]
jobs:
build:
runs-on: macOS-latest
timeout-minutes: 15
env:
@janziemba
janziemba / getLastInMap.js
Created October 7, 2019 08:47 — forked from tizmagik/getLastInMap.js
ES6 Last Item in Map()
// Since ES6 Map()'s' retain their order of insertion, it can sometimes be useful to get the last item or value inserted:
export const getLastItemInMap = map => Array.from(map)[map.size-1]
export const getLastKeyInMap = map => Array.from(map)[map.size-1][0]
export const getLastValueInMap = map => Array.from(map)[map.size-1][1]
// Obviously getLastKey and getLastValue can reuse getLastItem, but for maximum portability I opted for verbosity.
@janziemba
janziemba / RNMultipleTargetsInstructions.md
Created July 19, 2019 14:58 — forked from jacks205/RNMultipleTargetsInstructions.md
Settings up multiple app targets in React-Native

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@janziemba
janziemba / valid_email.md
Last active June 27, 2018 17:35 — forked from juanpablocs/valid_email.md
Regex for valid email

regex valid update

const validEmail(str) => !/(\.{2}|-{2}|_{2})/.test(val) && /^[a-z0-9][a-z0-9-_\.]+@[a-z0-9]+([a-z0-9-])?[a-z0-9]\.[a-z]{2,10}(?:\.[a-z]{2,10})?$/.test(val);

validEmail('admin@gmail.com'); //true
validEmail('.admin@gmail.com'); //false
validEmail('admin--admin@gmail.com'); //false
validEmail('admin@-myapp-.com'); //false
validEmail('admin@my-large-domain.news'); //valid
@janziemba
janziemba / AppDelegate.m
Last active April 18, 2020 08:35
React Native - use launch image as app background on iOS
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"Reservio"
initialProperties:nil
launchOptions:launchOptions];
@janziemba
janziemba / AppDelegate.m
Created March 13, 2018 10:28 — forked from Jpoliachik/AppDelegate.m
ReactNative iOS Launch Screen No Flash
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 1. init window
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
// 2. backgroundView using LaunchScreen.xib
UIView *backgroundView = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] firstObject];
backgroundView.frame = self.window.bounds;
@janziemba
janziemba / react-native-ios-splash.m
Created January 11, 2018 15:54 — forked from benvium/react-native-ios-splash.m
React Native iOS Smooth Splash Screen (when using LaunchScreen.xib)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
...
...
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"MyAwesomeApp"
initialProperties:@{}
launchOptions:launchOptions];
@janziemba
janziemba / gist:a694b9a71942c702498b25e74ef25d26
Created October 4, 2017 11:06 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@janziemba
janziemba / fabric-js-restaurant-reservation-system.markdown
Created May 18, 2017 12:29
Fabric.js Restaurant reservation system