Skip to content

Instantly share code, notes, and snippets.

View hprobotic's full-sized avatar
:dependabot:
On Break

John Pham hprobotic

:dependabot:
On Break
View GitHub Profile
@hprobotic
hprobotic / charge.py
Created September 11, 2019 01:28
Stripe payment
def create_stripe_payment(recipient_type, payment_method, scheduled_transaction, current_user, total_charge):
connected_stripe_account_id = get_stripe_account_id(
recipient_type,
payment_method.brand,
scheduled_transaction.source_currency)
paymentIntent = None
# Old method => Need to do migrate
dest_charge = None
try:
pay_source = stripe.Source.create(
@hprobotic
hprobotic / clean_my_mac_x_guide.md
Last active November 10, 2024 15:39
CleanMyMac X tutorial
  • 1. Install the trial from https://macpaw.com/cleanmymac
  • 2. Open CleanMyMac then click Action then Authenticate
  • 3. Install the CleanMyMac installer from here, click replace 
  • 4. I didn’t try to open the app. 
  • 5. Run: sudo xattr -r -d com.apple.quarantine /Applications/CleanMyMac\ X.app
  • 6. Run codesign -f -s – –deep /Applications/CleanMyMac\ X.app/ (Check note)
  • 7. Open CleanMyMac

Notes:

import boto3
# other libs import
s3 = boto3.client(
's3',
aws_access_key_id=AWS_ACCESS_KEY,
aws_secret_access_key=AWS_SECRET_KEY,
region_name=AWS_REGION_NAME
)
[
{
"fields": [
{
"group": [
{
"refreshRequirementsOnChange": false,
"validationRegexp": null,
"name": "Recipient type",
"validationAsync": null,
{
"status": "success",
"data": [
{
"example": "",
"type": "select",
"key": "legalType",
"displayFormat": null,
"minLength": null,
"maxLength": null,
@hprobotic
hprobotic / doc.md
Created November 26, 2018 08:50
Bug fix with flask, mysql and tox
  • Fix mysqlclient:
  • Check brew info openssl
Givens a data.json file with structure bellow:
// data.json
[
{
"name": "Electronics",
"items": ["Phone", "Keyboards"]
},
{
"name": "Keyboards",
var x = Math.floor(Math.random() * 9) + 1;
var turns = 0;
var hint = 'Guess my number, 1-10!';
while (turns < 10) {
var guess = prompt(hint);
if (!guess) break;
guess = Number(guess);
if (guess == x) {
alert("Congratulations, you are a mind reader!");
#EXTM3U
#EXTINF:-1,VTV1
http://113.189.21.251:4022/rtp/232.84.1.27:8136
#EXTINF:-1,VTV1 HD
http://113.189.21.251:4022/rtp/232.84.1.117:10254
#EXTINF:-1,VTV2
http://113.189.21.251:4022/rtp/232.84.1.39:8208
#EXTINF:-1,VTV3
http://113.189.21.251:4022/rtp/232.84.1.28:8142
#EXTINF:-1,VTV3 HD
@hprobotic
hprobotic / .eslintrc
Created March 29, 2018 12:01
hapijs eslintrc
{
"extends": "eslint-config-airbnb",
"parser": "babel-eslint",
"rules": {
"no-console": [1],
"max-len": [1, 120, 2, { "ignoreComments": true }],
"no-else-return": [0],
"import/prefer-default-export": [0],
"arrow-body-style": [0],
"class-methods-use-this": [0]