Skip to content

Instantly share code, notes, and snippets.

View 0x62's full-sized avatar

Ben 0x62

  • ProcessLabs
  • United Kingdom
  • 13:33 (UTC +01:00)
View GitHub Profile
@0x62
0x62 / RpcApi.js
Created September 4, 2021 13:42
Hacky workaround
import { ethers } from 'ethers'
class RpcApi {
constructor({ endpoint, address, abi }) {
this._endpoint = endpoint
this._address = null
this._abi = null
this._id = 0
if (abi && address) this.setContract({ address, abi })
return new Promise((resolve, reject) => {
// Get current state (required, otherwise requestLocationAuthorization
// callback is triggered before change)
cordova.plugins.diagnostic.getLocationAuthorizationStatus(state => {
let res = validateState(state);
if (res.code == 0) {
return resolve();
} else if (res.code == 1) {
return reject(res);
const admin = require('firebase-admin');
admin.initializeApp({
databaseURL: process.env.FIREBASE_URI,
credential: admin.credential.cert({
projectId: 'angular-stacker-123723',
clientEmail: 'firebase-adminsdk-xlnkn@angular-stacker-123723.iam.gserviceaccount.com',
privateKey: process.env.FIREBASE_KEY
})
})
import { GoogleMapsAPIWrapper } from '@agm/core';
import { Directive, Output, EventEmitter } from '@angular/core';
declare var google: any;
@Directive({
selector: 'agm-location-marker'
})
export class AgmLocationMarker {
marker: any;

Keybase proof

I hereby claim:

  • I am 0x62 on github.
  • I am 0x62 (https://keybase.io/0x62) on keybase.
  • I have a public key whose fingerprint is A246 3247 FD0E 5075 D8ED 8456 58D1 DCED 045D 6087

To claim this, I am signing this object:

@0x62
0x62 / gist:a3099bd046deb801955e
Last active April 23, 2016 02:03
AppleScript to update DNS servers
display dialog "What is your pass word?" default answer ""
set pass to text returned of result
display dialog "Primary DNS server" default answer ""
set dns1 to text returned of result
display dialog "Secondary DNS server" default answer ""
set dns2 to text returned of result
tell application "Terminal" to activate
tell application "Terminal"
do script ("echo " & pass & " | sudo -S networksetup -setdnsservers Wi-Fi " & dns1 & " " & dns2) in window 1
end tell