Skip to content

Instantly share code, notes, and snippets.

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 June 28, 2018 08:25
generate firestore token for backoffice user
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 December 13, 2017 09:43
proxy for metabase to run behind IIS
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"os"
"os/exec"
"time"
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;
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;
package main
import (
"encoding/base32"
"encoding/binary"
"fmt"
"math/rand"
"time"
)
@jittuu
jittuu / nCr.go
Created July 7, 2015 13:58
Binomial coefficient
package main
import "fmt"
func main() {
//nCr
n := 7
r := 2
c := BinCoeff(n, r)

Set up

Download and install ResEx at http://resex.codeplex.com/.

Adding additional language

  1. Open resx file with ResEx. You would see as below. In this example, we have two additional languages (Indonesia and Simplified Chinese). image
@jittuu
jittuu / CaptchaBreaker.cs
Created December 18, 2014 15:01
CaptchaBreaker using tesseract
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@jittuu
jittuu / coding-guidelines.md
Last active December 12, 2019 16:40
C# Coding Guidelines

This document is stolenbased on [nuget coding guidelines][nuget] and microsoft [internal coding guidlines][ms-coding-guidelines].

Coding Guidelines

Let's face it. No matter what coding guidelines we choose, we're not going to make everyone happy. While we would like to embrace everyone's individual style, working together on the same codebase would be utter chaos if we don't enforce some consistency. When it comes to coding guidelines, consistency can be even more important than being "right."

Definitions

  • [Camel case][] is a casing convention where the first letter is lower-case, words are not separated by any character but have their first letter capitalized. Example: thisIsCamelCased.
  • [Pascal case][] is a casing convention where the first letter of each word is capitalized, and no separating character is included between words. Example: ThisIsPascalCased.