Skip to content

Instantly share code, notes, and snippets.

@Janak-Nirmal
Janak-Nirmal / react-native-setup.md
Created February 14, 2024 12:55 — forked from aadilmallick/react-native-setup.md
A complete steup guide to any react native + expo project. The stack is expo + typescript + tailwindcss

Get started

npx create-expo-app --template

Heavy full on installation

@Janak-Nirmal
Janak-Nirmal / filterArray.js
Created April 8, 2022 06:49 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@Janak-Nirmal
Janak-Nirmal / multiple_ssh_setting.md
Created December 3, 2021 07:39 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@Janak-Nirmal
Janak-Nirmal / TabParallax.js
Created June 12, 2020 08:26 — forked from andigu/TabParallax.js
A react native component featuring parallax scrolling with tabs
import React, {Component} from "react";
import {Animated, Dimensions, Platform, Text, TouchableOpacity, View} from "react-native";
import {Body, Header, List, ListItem as Item, ScrollableTab, Tab, TabHeading, Tabs, Title} from "native-base";
import LinearGradient from "react-native-linear-gradient";
const {width: SCREEN_WIDTH} = Dimensions.get("window");
const IMAGE_HEIGHT = 250;
const HEADER_HEIGHT = Platform.OS === "ios" ? 64 : 50;
const SCROLL_HEIGHT = IMAGE_HEIGHT - HEADER_HEIGHT;
const THEME_COLOR = "rgba(85,186,255, 1)";
@Janak-Nirmal
Janak-Nirmal / notes.md
Created November 18, 2019 10:10 — forked from matthewjberger/notes.md
How to make an electron app using Create-React-App and Electron with Electron-Builder.
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}
//
// NSAttributedString+RZExtensions.h
// Raizlabs
//
// Created by Alex Rouse on 12/13/13.
// Copyright 2014 Raizlabs and other contributors
// http://raizlabs.com/
//
// Permission is hereby granted, free of charge, to any person obtaining
// See http://mindsea.com/2012/12/18/downscaling-huge-alassets-without-fear-of-sigkill for details
#import <AssetsLibrary/AssetsLibrary.h>
#import <ImageIO/ImageIO.h>
// Helper methods for thumbnailForAsset:maxPixelSize:
static size_t getAssetBytesCallback(void *info, void *buffer, off_t position, size_t count) {
ALAssetRepresentation *rep = (__bridge id)info;
NSError *error = nil;
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}

List of Block Declaration Syntaxes

Throughout, let

  • return_type be the type of object/primitive/etc. you'd like to return (commonly void)
  • blockName be the variable name of the block you're creating
  • var_type be the type object/primitive/etc. you'd like to pass as an argument (leave blank for no parameters)
  • varName be the variable name of the given parameter And remember that you can create as many parameters as you'd like.

Blocks as Variables

Possibly the most common for of declaration.