Skip to content

Instantly share code, notes, and snippets.

@intelliot
intelliot / popupbridge-paypaldatacollector-ios.md
Last active February 28, 2017 23:58
PopupBridge + PayPalDataCollector (iOS)

One time payment

Implement the method that receives the popup URL and use this sample code to parse the clientMetadataID:

// In your POPPopupBridgeDelegate
- (void)popupBridge:(POPPopupBridge *)bridge willOpenURL:(NSURL *)url {
    NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name IN %@", @[@"token", @"ba_token"]];
 NSURLQueryItem *queryItem = [[components.queryItems filteredArrayUsingPredicate:predicate] firstObject];

Keybase proof

I hereby claim:

  • I am intelliot on github.
  • I am el (https://keybase.io/el) on keybase.
  • I have a public key ASCjbyFkeiCbSG7hjzsr910QsWKDT3H3aELofZepZZJfzAo

To claim this, I am signing this object:

@intelliot
intelliot / bundle-browser-in-package-json-npm-install.js
Created February 7, 2018 23:32
ripple-lib-browser-client - bundle.js
This file has been truncated, but you can view the full file.
(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){
const RippleAPI = require('ripple-lib').RippleAPI;
let api = new RippleAPI({
server: 'wss://s1.ripple.com:443'
});
api.connect().then(() => {
api.getServerInfo().then(info => {
document.body.innerHTML = JSON.stringify(info);
➜ cm_build git:(develop) ✗ BOOST_ROOT=~/Downloads/boost_1_65_1 cmake -G "Unix Makefiles" -Dtarget=clang.debug.unity ..
CMake Warning at /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:771 (message):
Imported targets not available for Boost version 106501
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:875 (_Boost_COMPONENT_DEPENDENCIES)
/usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/FindBoost.cmake:1503 (_Boost_MISSING_DEPENDENCIES)
Builds/CMake/CMakeFuncs.cmake:352 (find_package)
CMakeLists.txt:143 (use_boost)

Getting this error? Looks like something changed between eslint 2.7.0 and eslint 6.1.0.

% yarn lint
yarn run v1.17.3
$ ./node_modules/.bin/eslint -c ./eslintrc Gulpfile.js **/*.js

Oops! Something went wrong! :(

ESLint: 6.1.0.
@intelliot
intelliot / fix-ERROR-root-code-for-hash-md5-was-not-found.md
Created June 5, 2020 05:14
Fix "ERROR:root:code for hash md5 was not found."

If you get this error:

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
@intelliot
intelliot / fix-ERROR-root-code-for-hash-md5-was-not-found.md
Created June 5, 2020 05:15
Fix "ERROR:root:code for hash md5 was not found."

If you get this error:

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
@intelliot
intelliot / fix-ERROR-root-code-for-hash-md5-was-not-found.md
Created June 5, 2020 05:15
Fix "ERROR:root:code for hash md5 was not found."

If you get this error:

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
@intelliot
intelliot / exarpy.js
Created February 5, 2021 05:15
Exarpy Wallet PIN to Secret Key Conversion Code
var customFunctionTestPin = function (customArgPin) {
if (customArgPin.length !== 16) {
document.getElementById('warning').innerHTML = "<strong>Invalid PIN:</strong> Your PIN should be 16 numbers, separated by commas.";
return false;
}
for (var customIterator1 = 0; customIterator1 < 16; customIterator1 += 1) {
if (customArgPin[customIterator1] < 0 || customArgPin[customIterator1] > 255) {
document.getElementById('warning').innerHTML = "<strong>Invalid PIN:</strong> Every PIN value must be between 0 and 255, inclusive.";
return false;
}
@intelliot
intelliot / token.js
Created March 16, 2021 23:16
Code from RippleXDev Twitch episode on March 16, 2021
// Code from RippleXDev Twitch episode on March 16, 2021
//
// Code is provided "as is" and solely for informational purposes only.
// Warning: Use at your own risk.
// Install dependencies:
// npm install bignumber.js ripple-lib
//
// Milliseconds between checks for transaction validation