Skip to content

Instantly share code, notes, and snippets.

View wechain's full-sized avatar

Anthony Lai wechain

  • Kuala Lumpur, Malaysia
View GitHub Profile
@wechain
wechain / Bullseye.bookmarklet
Created October 24, 2018 12:47 — forked from ttscoff/Bullseye.bookmarklet
A bookmarklet for grabbing just a piece of a web page and converting it to Markdown using heckyesmarkdown.com.
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://cdn.rawgit.com/ttscoff/6109434/raw/Bullseye.js?x="+(Math.random());})();
@wechain
wechain / htmltomd.sh
Created October 24, 2018 12:48 — forked from ecampidoglio/htmltomd.sh
A Bash script that downloads the HTML source from a list of URLs and converts it to Markdown. The source file must contain each URL to download from on a separate line. The actual conversion is done by the awesome API available at http://heckyesmarkdown.com
#!/bin/bash
# htmltomd
# Downloads the HTML source from a list of URLs and converts it to Markdown.
# The source file must contain each URL to download from on a separate line.
# The actual conversion is done by the awesome API available at
# http://heckyesmarkdown.com
urlsFile=$1
outputDir=${2:-.} # Defaults to local dir
<div class="text-rtl">
<p>
<h5>לתמונת הפרופיל ולתמונת הנושא שלכם יש חשיבות גדולה לשגשוג שלכם בסטימאיט מכיוון שהם ממתגים את הפרופיל שלכם וגורמים לו להיות זכיר בין מגוון הפוסטים בקהילה. <br>
בפוסט זה אסביר כיצד ליצור תמונת פרופיל ונושא נכונים, כיצד להעלות אותם לאינטרנט ואיך לגרום לתמונה להופיע בפרופיל האישי.<br>
קריאה מהנה!😉 <br> <br>
https://i.imgur.com/znTupeP.png
</h5>
<hr>
@wechain
wechain / handbrake_cli.md
Created November 7, 2018 07:40 — forked from zulhfreelancer/handbrake_cli.md
How to compress video using Handbrake CLI?

Step 1

Download HandBrake CLI for your OS here.

Step 2

cd into the folder where you have the HandBrakeCLI file and run this inside it:

./HandBrakeCLI -i /path/to/input.mov -o /path/to/output.mp4 -e x264 -q 28 -r 15 -B 64 -X 1280 -O
{
"PresetList": [
{
"AlignAVStart": false,
"AudioCopyMask": [
"copy:aac",
"copy:ac3",
"copy:eac3",
"copy:dtshd",
"copy:dts",
@wechain
wechain / recursive-m4v-convert.sh
Last active November 20, 2022 10:35 — forked from philroche/recursive-m4v-convert.sh
Recursively convert all files using HandbrakeCLI and save to new folder.
#!/bin/bash
#
# Change this to specify a different handbrake preset. You can list them by running: "HandBrakeCLI --preset-list"
#
#set -ux
set +e
PRESET="Vimeo YouTube 720p30" # or Fast 720p30 or Fast 1080p30
if [ -z "$1" ] ; then
TRANSCODEDIR="."
else
@wechain
wechain / simple_convert.py
Last active November 8, 2018 18:40 — forked from onedr0p/simple_convert.py
A simple script to convert media files to MP4 for a better Plex experience
# Python 2.7
import os
import sys
import time
import platform
import subprocess
import urllib2
import logging
@wechain
wechain / to_hevc.sh
Created November 8, 2018 19:21 — forked from dev01d/to_hevc.sh
This script automatically converts a directory of video files to H.265 HEVC with the nightly iteration of HandBrake and deletes the old files.
#!/bin/bash
#
# This script automatically converts a directory of video files to H.265 HEVC with the nightly iteration of HandBrake.
# https://handbrake.fr/nightly.php
# The nightly is required because the current stable release (as of writing this) does not support the "hvc1" codec
# that tvOS requires on top of only really liking mp4/m4a.
#
if [ -z "$1" ]; then
SRC="."
else
@wechain
wechain / xmrig_start.sh
Last active September 24, 2021 04:21 — forked from dot-pulsar/test.sh
xmrig_start
#!/bin/bash
#POOL="de.minexmr.com:443"
#POOL="sg.minexmr.com:443"
#PAYTO="865kjopGVkABniUeparZntDDNDP3eMrVz1UFvBXSuTjb8ZfYTyQSt9GRsVeBFXhFCwK7zmqvh7a4dCrwSyo3r9GGNstLLR2"
#RIG="C2"
#CPUS="4"
#EXTRA="--cpu-affinity 0xFF"
#if [ "$1" == "" ]; then
@wechain
wechain / vps-boot.sh
Last active September 18, 2021 11:02 — forked from thephez/vps-mn-boostratp-prep.sh
Vultr boot startup script - mn-bootstrap prep
#!/bin/sh
# Based on instructions from
# https://docs.dash.org/en/stable/masternodes/setup-testnet.html
#
# See https://www.vultr.com/docs/vultr-startup-scripts-quickstart-guide
# for details of using Vultr startup scripts
# Add new user
# USERNAME=miner # Username to create