Skip to content

Instantly share code, notes, and snippets.

@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
#!/bin/bash -
export AWS_ACCESS_KEY=<your aws access key>
export AWS_SECRET_KEY=<your aws secret>
date_current=`date -u +%Y-%m-%d`
aws rds describe-db-snapshots --snapshot-type "automated" --db-instance-identifier <db_instance_name> | grep `date +%Y-%m-%d` | grep rds | tr -d '",' | awk '{ print $2 }' > /tmp/sandbox-snapshot.txt
snapshot_name=`cat /tmp/<db_instance_name>-snapshot.txt`
target_snapshot_name=`cat /tmp/<db_instance_name>-snapshot.txt | sed 's/rds://'`
@uniacid
uniacid / Vagrantfile
Created March 3, 2017 20:19
Vagrant configuration file with OS detection - on windows we mount shared folders without NFS - on all other OS we use NFS for speeding up the project inside the virtual machine
# -*- mode: ruby -*-
# vi: set ft=ruby :
module OS
def OS.windows?
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end
def OS.mac?
(/darwin/ =~ RUBY_PLATFORM) != nil
@uniacid
uniacid / autodl-irssi
Created January 13, 2017 18:48 — forked from phracker/autodl-irssi
A system init script for autodl-irssi
#!/bin/sh
# https://github.com/phracker
#
# AutoDL-Irssi Init Script
# Tested on Debian 7 (Wheezy)
# Instructions:
# - Install / configure irssi + autodl-irssi (duh)
# - Save this script as /etc/init.d/autodl-irssi
# - `chmod +x /etc/init.d/autodl-irssi`
# - `insserv autodl-irssi`
#!/usr/bin/perl
#
# tracker_modify.pl 0.01
# Add/delete trackers recursively from all torrents.
# Free to copy and mutilate any way you like :)
#
# Originally from http://publicbt.com/tracker_modify.pl
sub usage {
print <<EOF