Skip to content

Instantly share code, notes, and snippets.

@jittuu
jittuu / QRCodeScanner.tsx
Created Nov 28, 2018
QR Code Scanner for React Native
View QRCodeScanner.tsx
import { debounce } from 'lodash';
import React from 'react';
import {
Dimensions,
StyleSheet,
TouchableOpacity,
View,
ViewStyle,
} from 'react-native';
import { BarCodeType, Point, RNCamera, Size } from 'react-native-camera';
@jittuu
jittuu / PhotoStateList.tsx
Created Nov 19, 2018
usage of FirebaseInfiniteFlatList
View PhotoStateList.tsx
import React from 'react';
import {
Dimensions,
Image,
ListRenderItemInfo,
StyleSheet,
Text,
TouchableWithoutFeedback,
View,
ViewStyle,
@jittuu
jittuu / FirebaseInfiniteFlatList.tsx
Created Nov 19, 2018
Infinite FlatList with Firebase integration
View FirebaseInfiniteFlatList.tsx
import { throttle } from 'lodash';
import React from 'react';
import { ActivityIndicator, FlatList, ListRenderItem } from 'react-native';
import { RNFirebase } from 'react-native-firebase';
import { Subject, Subscription } from 'rxjs';
type Query = RNFirebase.firestore.Query;
type DocumentSnapshot = RNFirebase.firestore.DocumentSnapshot;
interface P<T> {
View ConnectionStatus.tsx
import React from 'react';
import {
StyleSheet,
Text,
ViewStyle,
} from 'react-native';
import { TextStyle } from 'react-native';
import { ViewProps } from 'react-native';
import { LayoutAnimation } from 'react-native';
import * as Animatable from 'react-native-animatable';
@jittuu
jittuu / auth.ts
Created Jun 28, 2018
generate firestore token for backoffice user
View auth.ts
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
import { compare } from 'bcryptjs';
import { Merchant } from '../state';
interface AuthRequest {
username: string;
password: string;
}
@jittuu
jittuu / main.go
Created Dec 13, 2017
proxy for metabase to run behind IIS
View main.go
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"os"
"os/exec"
"time"
View DateInput.tsx
import * as React from 'react';
import * as moment from 'moment';
import { LocaleUtils, Modifier } from 'react-day-picker';
import DayPickerInput from 'react-day-picker/lib/src/DayPickerInput';
const dateFormat = 'DD/MM/YYYY';
interface YearMonthProps {
date?: Date;
View DateInput.tsx
import * as React from 'react';
import * as moment from 'moment';
import { LocaleUtils, Modifier } from 'react-day-picker';
import DayPickerInput from 'react-day-picker/lib/src/DayPickerInput';
const dateFormat = 'DD/MM/YYYY';
interface YearMonthProps {
date?: Date;
View fiveBytesID.go
package main
import (
"encoding/base32"
"encoding/binary"
"fmt"
"math/rand"
"time"
)
@jittuu
jittuu / nCr.go
Created Jul 7, 2015
Binomial coefficient
View nCr.go
package main
import "fmt"
func main() {
//nCr
n := 7
r := 2
c := BinCoeff(n, r)
You can’t perform that action at this time.