Skip to content

Instantly share code, notes, and snippets.

from paypalrestsdk.resource import List, Find, Create, Post, Update, Replace, Resource
from paypalrestsdk.api import default as default_api
import paypalrestsdk.util as util
from paypalrestsdk.exceptions import MissingParam
class Sale(Find, Post):
"""Sale class wrapping the REST v1/payments/sale endpoint
Usage::
@ahmadmarafa
ahmadmarafa / FileUpload.js
Created August 24, 2019 12:11
antd fileupload on form submit
import React, { Component } from 'react'
import { Upload, Form, Icon } from "antd";
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 },
from paypalrestsdk.resource import List, Find, Create, Post, Update, Replace, Resource
from paypalrestsdk.api import default as default_api
import paypalrestsdk.util as util
from paypalrestsdk.exceptions import MissingParam
class Sale(Find, Post):
"""Sale class wrapping the REST v1/payments/sale endpoint
Usage::
@viktorpetryk
viktorpetryk / mailhog-install.md
Last active January 27, 2023 09:08
MailHog installation on Ubuntu

Install & Configure MailHog

  1. Download and make it executable
wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
sudo cp MailHog_linux_amd64 /usr/local/bin/mailhog
sudo chmod +x /usr/local/bin/mailhog
  1. Make MailHog as a service
@ntamvl
ntamvl / fixed_kernal_task_high_cpu_on_macos.md
Last active February 21, 2024 11:10
Fixed the fan running high, kernel task taking up 500% cpu (high cpu) on macOS

Fixed the fan running high, kernel task taking up 500% cpu (high cpu)

Step 1: Disable SIP

Enter recovery mode

  • Shutdown your macbook
  • Press keys: Command + R
  • Press power button
  • Release keys Command + R when see Apple logo appear
  • Open Terminal app on recovery screen, then run below command:
@VesperDev
VesperDev / RouterApp.js
Last active May 12, 2024 05:08
Sider menu + ant-design + react-router-dom
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Layout, Menu, Icon } from 'antd';
import Dashboard from './containers/Dashboard/Dashboard';
import Meseros from './containers/Meseros/Meseros';
const { Header, Content, Footer, Sider } = Layout;
const SubMenu = Menu.SubMenu;
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@composite
composite / bitvistsshclientservice.bat
Last active March 15, 2024 10:56
Bitvise SSH Client as a Windows service with NSSM example.
@REM How to use before run this batch: You need Bitvise SSH Client and NSSM. if you haven't, google it and download and install.
@REM 1. open bitvise SSG Client
@REM 2. click "New Profile" to save profile.
@REM 3. configure SSH infomation, tunnels, etc.
@REM 4. click "Save Profile" to save profile.
@REM 5. on "sensitive" dialog popup, check "any account on this computer" or below to service account can connect it.
@REM 6. click "Login" to connect and test SSH Connection.
@REM 7. click "Accept & Save" if you see host key dialog popup.
@REM 8. Click "host key manager"
@REM 9. select your SSH host and click "Export". then click "Bitvise format" and save host key file.
@Propaganistas
Propaganistas / MailHog configuration
Last active March 13, 2024 14:26
Laravel MailHog SMTP configuration
# Mailhog
MAIL_MAILER=smtp
MAIL_HOST=0.0.0.0
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);