Skip to content

Instantly share code, notes, and snippets.

View enestatli's full-sized avatar
💭
I may be slow to respond.

enestatli

💭
I may be slow to respond.
View GitHub Profile
@levynir
levynir / RotatingView.js
Last active January 19, 2021 09:52
React Native Rotating Component
/**
* Created by nirlevy on 02/07/2017.
* MIT Licence
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Animated, Easing } from 'react-native';
export class RotatingView extends Component {
state = {
@duncanmcdougall
duncanmcdougall / ClearItAllBookmarklet.js
Created July 27, 2017 08:43
Bookmarklet to Clear Cookies, LocalStorage and Session Storage
javascript:(function(){ localStorage.clear(); sessionStorage.clear(); var c = document.cookie.split("; "); for (i in c) { document.cookie =/^[^=]+/.exec(c[i])[0]+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; }; })();
@IgorMing
IgorMing / barcodescanner.js
Last active October 19, 2024 20:55
Barcode Scanner on React Native (with expo), stylized with opaque edges
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { BarCodeScanner } from 'expo';
export default class App extends React.Component {
render() {
return (
<BarCodeScanner
onBarCodeRead={(scan) => alert(scan.data)}
style={[StyleSheet.absoluteFill, styles.container]}
@Mohamed3on
Mohamed3on / batchPrettier.md
Last active January 7, 2025 03:23
Run prettier on all JS files in a directory
  1. Install prettier
  2. Make a .prettierignore file, and add directories you'd like prettier to not format, for example: **/node_modules
  3. Run prettier --write "**/*.js" *Don't forget the quotes.
  4. Optional: if you want to format JSON/SCSS files too, replace js with json/scss.
@alanbosco
alanbosco / convert.py
Created October 4, 2017 18:57
Convert .CSV to VCF Python
# -*- coding: utf-8 -*-
#python 3.x
import csv
import sys
#convert a "comma separated values" file to vcf contact cards. I used this to convert a list of student
#names and phone numbers into a vcf and save the trouble of adding one by one through phone
#USAGE:
@jordanmkoncz
jordanmkoncz / .react-navigation iOS 11 Navigation Bar with Large Title
Last active March 10, 2025 15:57
react-navigation iOS 11 Navigation Bar with Large Title
#
@xuan9
xuan9 / getiOSDistName.sh
Last active May 6, 2021 06:50
react native packaging scripts
export shortVersion=$( /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ios/myapp/Info.plist );
export bundleVersion=$( /usr/libexec/PlistBuddy -c "Print CFBundleVersion" ios/myapp/Info.plist );
export distName=MyApp-$shortVersion-$bundleVersion
@jamesreggio
jamesreggio / react-forwardref-simple-example.js
Last active February 6, 2025 02:06
Simple example usage of React.forwardRef()
// EmailInput wraps an HTML `input` and adds some app-specific styling.
const EmailInput = React.forwardRef((props, ref) => (
<input ref={ref} {...props} type="email" className="AppEmailInput" />
));
class App extends Component {
emailRef = React.createRef();
render() {
return (
@axemclion
axemclion / JSIObject.cpp
Last active October 4, 2023 19:36
React Native JSI Example
// This sample is a Work in Progress for JSI , and specific functions may change.
#pragma once
#include <string>
#include <unordered_map>
#include <jsi/jsi.h>
// This SameplJSIObject needs to inheric from HostObject, and this is the object that will be exposed to JS.
# 1. Unlock keychain for auto-signing package *
security unlock-keychain -p <your-admin-password> ~/Library/Keychains/login.keychain
# 2. Build JS-bundle to Xcode project
react-native bundle --entry-file='index.js' --bundle-output='./ios/<your-app-name>/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
# 3. Building an archive
xcodebuild -project ./ios/<your-project-name>.xcodeproj -scheme '<your-scheme-name>' -derivedDataPath ./ios/build -archivePath ./ios/archive/<your-app-name>.xcarchive archive | xcpretty
# 4. Export the archive to an *.ipa package