Skip to content

Instantly share code, notes, and snippets.

View arth2o's full-sized avatar

ArtH2O arth2o

View GitHub Profile
@arth2o
arth2o / Python script upscale your image with AI
Created October 18, 2022 09:07
Batch Upscale Your .jpg Photos in a folder using AI and Python. Call Python3 ./script.py
# install
# Upscale Your Photos
# pip install super-image
# pip install pillow
from super_image import *
from PIL import Image
import os, sys, glob
from pathlib import Path
from datetime import datetime
@arth2o
arth2o / Resize .jpg images in a folder
Created October 18, 2022 09:05
Resize .jpg in a folder keep aspect ratio. New image name will be extend with _t tag.
#!/usr/bin/python
# install
# pip install super-image
from PIL import Image
import os, sys, glob
path = "./"
dirs = os.listdir( path )
#!/bin/bash
# Anh Nguyen <anh.ng8@gmail.com>
# 2016-04-30
# MIT License
# This script takes in images from a folder and make a crossfade video from the images using ffmpeg.
# Make sure you have ffmpeg installed before running.
# The output command looks something like the below, but for as many images as you have in the folder.
@arth2o
arth2o / php-style-guide.md
Created November 2, 2021 17:09 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@arth2o
arth2o / curl.md
Created October 2, 2018 17:17 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@arth2o
arth2o / encrypt_openssl.md
Created September 28, 2018 11:28 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@arth2o
arth2o / ipfs-server-setup.md
Created September 22, 2018 09:46 — forked from claus/ipfs-server-setup.md
Host Your Site Under Your Domain on IPFS

Host Your Site Under Your Domain on IPFS

This is a step-by-step tutorial for hosting your website under your domain on IPFS, from zero, on a DigitalOcean Ubuntu 16.04.3 x64 Droplet (i am using the $10 variant with 2GB RAM).

Install IPFS

Log in as root.

First, make sure the system is up to date, and install tar and wget:

@arth2o
arth2o / Artisan.php
Created September 7, 2018 14:31
Laravel Cheat Sheet
php artisan --help OR -h
php artisan --quiet OR -q
php artisan --version OR -V
php artisan --no-interaction OR -n
php artisan --ansi
php artisan --no-ansi
php artisan --env
// -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
php artisan --verbose
@arth2o
arth2o / Headless Chrome - puppeteer ignore ignoreHTTPSErrors warnings
Created October 4, 2017 12:25
puppeteer chrome headless ssl certification error handling ignoreHTTPSErrors
const puppeteer = require('puppeteer');
const cheerio = require('cheerio');
const striptags = require('striptags');
function cleanText(text) {
text = text.replace(/\s{2,}/g,' ');
text = striptags(text).trim();
return text;
}