Skip to content

Instantly share code, notes, and snippets.

View olegdater's full-sized avatar
💭
Busy with Humanornot.so

@HumanCEO olegdater

💭
Busy with Humanornot.so
View GitHub Profile
@JamieCurnow
JamieCurnow / firestore.ts
Last active June 5, 2024 17:56
Using Firestore with Typescript
/**
* This Gist is part of a medium article - read here:
* https://jamiecurnow.medium.com/using-firestore-with-typescript-65bd2a602945
*/
// import firstore (obviously)
import { firestore } from "firebase-admin"
// Import or define your types
// import { YourType } from '~/@types'
#!/bin/bash
# Put this in /hooks/after_prepare/
PLIST=platforms/ios/*/*-Info.plist
cat << EOF |
Add :NSAppTransportSecurity dict
Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool YES
Add :NSAppTransportSecurity:NSExceptionDomains:facebook.com:NSIncludesSubdomains bool YES
Add :NSAppTransportSecurity:NSExceptionDomains:facebook.com:NSThirdPartyExceptionRequiresForwardSecrecy bool NO
@ethers
ethers / call-then-sendtx-pattern.js
Last active July 24, 2020 05:51
call-then-sendtx pattern for Ethereum Dapps
/*
In Ethereum, a contract can be written so that it returns a value for eth_call.
A Dapp can then check for success or error value of eth_call, before calling eth_sendTransaction,
to take advantage of eth_call effectively being a "preview" of the code flow that the transaction
will take. In traditional client-server, clients can't ask servers beforehand what's going to
happen when the client makes a call; with Dapps contracts can be written so that clients can ask
for a "preview" of what is going to happen, before any funds/ethers are actually utilized
(eth_call does not cost any ethers).
Note: it is possible that in between eth_call and when eth_sendTransaction is actually mined,
@katowulf
katowulf / advanced.js
Last active December 30, 2016 01:31
Override $FirebaseArray.prototype.$$added in AngularFire (compatible with 0.9.x and above)
// create a class that we will use in place of the pojo (plain old javascript object)
// that is normally created in $FirebaseArray
function Person(snap) {
this.$id = snap.name();
this.updated(snap);
}
Person.prototype = {
updated: function(snap) {
this.data = snap.val();
@elgalu
elgalu / capabilities.js
Last active May 18, 2021 14:41
Protractor Browser Capabilities Extensions
////////////////////////////////////////////////
// Protractor Browser Capabilities Extensions //
////////////////////////////////////////////////
"use strict";
module.exports = browser.getCapabilities().then(function(s) {
var browserName, browserVersion;
var shortName, shortVersion;
var ie, ff, ch, sa;
var platform;
@elgalu
elgalu / toHaveClass.js
Last active August 2, 2019 21:38
toHaveClass custom Jasmine 1.3.1 html class matcher
"use strict";
var maxWaitTimeoutMs = 5000; // 5secs
var webdriver = require('selenium-webdriver');
var flow = webdriver.promise.controlFlow();
/**
* Custom Jasmine matcher builder that waits for an element to have
* or not have an html class.
* @param {String} expectation The html class name