Skip to content

Instantly share code, notes, and snippets.

@uniacid
uniacid / rename-torrents.py
Created September 7, 2023 02:32
Rename torrents to original filename
import os
import glob
import subprocess
import sys
import shutil
import re
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
@uniacid
uniacid / test312.js
Created March 19, 2021 16:28
String calculator
//10+5*2
const str = '10+5*2';
let total = 0;
let currentNum = '';
let operator = '';
for (var i = 0; i < str.length; i++) {
if (parseInt(str[i]) > -1) {
currentNum = currentNum + str[i];
@uniacid
uniacid / MailHog configuration
Created February 8, 2020 03:19 — forked from Propaganistas/MailHog configuration
Laravel MailHog SMTP configuration
# Mailhog
MAIL_DRIVER=smtp
MAIL_HOST=0.0.0.0
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
@uniacid
uniacid / mailhog-install.md
Created February 8, 2020 03:19 — forked from viktorpetryk/mailhog-install.md
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
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::
@uniacid
uniacid / gist:54240f8bbd92cbf412a1dff0ecd9f2a3
Created February 8, 2019 01:53 — forked from nuria/celery_before_after.py
Handlers that execute right before and right after a task is executed in celery.
from celery import Celery
from celery.signals import after_task_publish,task_success,task_prerun,task_postrun
# first argument, current module
app = Celery('tasks')
app.config_from_object('celeryconfig')
# To instantiate celery and import this module
# do: celery -A task worker --loglevel=info
# after, once celery is running, instantiate a python console:
@uniacid
uniacid / Magento_debug_controller_overrides.md
Created October 12, 2018 20:47 — forked from grafikchaos/Magento_debug_controller_overrides.md
Helpful debugging script for troubleshooting Magento overrides of controllers
@uniacid
uniacid / cloudSettings
Last active August 17, 2018 03:27
Visual Studio Code Settings Sync Gist #MBP
{"lastUpload":"2018-08-17T03:26:16.990Z","extensionVersion":"v3.0.0"}
@uniacid
uniacid / cloudSettings
Last active August 17, 2018 03:17
Visual Studio Code Settings Sync Gist #work
{"lastUpload":"2018-08-17T03:14:43.393Z","extensionVersion":"v3.0.0"}