Skip to content

Instantly share code, notes, and snippets.

View Pranit-Harekar's full-sized avatar
🏠
Working from home

Pranit Harekar Pranit-Harekar

🏠
Working from home
View GitHub Profile
### Keybase proof
I hereby claim:
* I am pranit-harekar on github.
* I am pranit (https://keybase.io/pranit) on keybase.
* I have a public key ASDlzy3ltiGe5-QT6Ml6dcEd9AVWQcN9PoCO_jBVJn1Zdwo
To claim this, I am signing this object:
@Pranit-Harekar
Pranit-Harekar / WKWebViews+keyboardRequiresUserInteraction.swift
Last active February 1, 2019 01:27
Add keyboardRequiresUserInteraction to WKWebViews iOS 11.3
import Foundation
import WebKit
typealias ClosureType = @convention(c) (Any, Selector, UnsafeRawPointer, Bool, Bool, Bool, Any?) -> Void
extension WKWebView{
var keyboardDisplayRequiresUserAction: Bool? {
get {
return self.keyboardDisplayRequiresUserAction
}
@Pranit-Harekar
Pranit-Harekar / xcode-cli-tools.sh
Last active September 22, 2017 13:46
Remote shell script to automatically install XCode CLI tools
#!/bin/sh
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
PROD=$(softwareupdate -l | grep "\*.*Command Line" | head -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n')
softwareupdate -i "$PROD" --verbose
rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
29288916: Importing base box 'sr-dev-29288916'...
==> 29288916: Matching MAC address for NAT networking...
==> 29288916: Setting the name of the VM: springboard-retail_29288916_1507050584476_60712
==> 29288916: Clearing any previously set network interfaces...
==> 29288916: Preparing network interfaces based on configuration...
29288916: Adapter 1: nat
29288916: Adapter 2: hostonly
==> 29288916: Forwarding ports...
29288916: 1080 (guest) => 1080 (host) (adapter 1)
29288916: 22 (guest) => 2222 (host) (adapter 1)
@Pranit-Harekar
Pranit-Harekar / tsconfig.json
Created December 25, 2017 02:34
Default tsconfig.json upon running tsc --init
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation: */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
@Pranit-Harekar
Pranit-Harekar / tsconfig.json
Last active June 2, 2018 21:21
Minimal TS compiler configuration required
{
"compilerOptions": {
/* Basic Options */
"target":
"es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */,
"module":
"commonjs" /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"lib": [
"es2015"
] /* Specify library files to be included in the compilation: */,
@Pranit-Harekar
Pranit-Harekar / App.tsx
Last active December 25, 2017 03:22
Demo TypeScript Setup
import * as React from "react";
import { StyleSheet, Text, View } from "react-native";
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native with TypeScript!</Text>
</View>
);
@Pranit-Harekar
Pranit-Harekar / index.js
Created December 25, 2017 03:20
Demo index.js
import { AppRegistry } from "react-native";
import App from "./build/App";
AppRegistry.registerComponent("StorybookDemo", () => App);
@Pranit-Harekar
Pranit-Harekar / debugSimulator.ts
Last active April 3, 2018 19:04
Debug Simulator
import { IRefundRequest, ISaleRequest, IVoidRequest } from '../payment/paymentRequest'
import { IRefundResult, ISaleResult, IVoidResult } from '../payment/paymentResult'
import {
DebugSimulatedRefundRequest,
DebugSimulatedSaleRequest,
DebugSimulatedVoidRequest,
} from './debugSimulatedRequest'
export type debugSimulatedRequest =
| DebugSimulatedSaleRequest
@Pranit-Harekar
Pranit-Harekar / project.rtf
Created April 7, 2018 15:13
Build Report
Undefined symbols for architecture x86_64:
"___gxx_personality_v0", referenced from:
AudioReader::~AudioReader() in libMTSCRA.a(AudioReader.o)
AudioReader::processSamples(int) in libMTSCRA.a(AudioReader.o)
AudioReader::dumpResponse() in libMTSCRA.a(AudioReader.o)
"std::terminate()", referenced from:
___clang_call_terminate in libMTSCRA.a(MTSCRA.o)
"operator delete(void*)", referenced from:
hasData(void*, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) in libMTSCRA.a(MTSCRA.o)
-[MTSCRA hexStringtoBytes:] in libMTSCRA.a(MTSCRA.o)