Skip to content

Instantly share code, notes, and snippets.

View WeZZard's full-sized avatar
😄
Coding maniac.

WeZZard WeZZard

😄
Coding maniac.
View GitHub Profile
import SwiftUI
class Model1: ObservableObject {
static let shared = Model1()
var value: Int = 0
@Published
var date: Date = Date()
@WeZZard
WeZZard / homebrew.distcc.service
Last active April 30, 2023 04:10
Changes to Homebrew distcc installation for being a compilation server.
[Unit]
Description=Homebrew generated unit for distcc
[Install]
WantedBy=default.target
[Service]
Type=simple
ExecStart=/opt/homebrew/opt/distcc/bin/distccd --allow 192.168.50.0/23 --daemon --no-detach
Restart=always
@WeZZard
WeZZard / convert-video-to-gif
Last active April 30, 2023 03:17
Convert video to gif with given resolution
#!/bin/sh
NAME=""
SCALE=""
PRESET="blog"
function parse_arg_input_file() {
NAME="$1"
return 0;
}
@WeZZard
WeZZard / dev-py-3-on-macOS-13
Last active January 30, 2023 20:14
Develop Python 3.x on macOS 13
#!/bin/sh
./configure --with-openssl="/opt/homebrew/opt/openssl@1.1"
pushd ../
mkdir cpython-compile-commands -p
popd
bear --output ../cpython-compile-commands/compile_commands.json -- make
@WeZZard
WeZZard / llvm-config
Last active November 2, 2022 07:41
llvm-config: config llvm build in macOS by putting the build dir beside llvm-project dir. The script must be in the same folder containing llvm-project.
#!/bin/sh
PARENT_DIR="$(dirname $(cd "$(dirname "$0")"; pwd)/$(basename "$0"))"
CONFIG=Debug;
ASSERT=on;
CONSECUTIVE_ARG_PARSE_KIND=None;
ARCH=$(uname -m)
PLATFORM="macosx"
LLVM_ENABLED_PROJECTS=()
LLVM_ENABLED_RUNTIMES=()
@WeZZard
WeZZard / embuild.sh
Created October 2, 2022 17:29
ffmpeg wasm + emscript build script
#!/bin/bash -x
# verify Emscripten version
emcc -v
# build ffmpeg.wasm
mkdir -p wasm/dist
ARGS=(
-I. -I./fftools
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample
@WeZZard
WeZZard / sshd_phabricator
Created February 8, 2022 05:31
FreeBSD sshd for Phabricator rc script.
#!/bin/sh
#
# $FreeBSD: releng/12.2/libexec/rc/rc.d/sshd 363553 2020-07-26 10:01:27Z 0mp $
#
# PROVIDE: sshd
# REQUIRE: LOGIN FILESYSTEMS
# KEYWORD: shutdown
. /etc/rc.subr
@WeZZard
WeZZard / .zshrc
Created August 20, 2021 04:54
zshrc
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="avit"
CASE_SENSITIVE="true"
plugins=(git sudo)
source $ZSH/oh-my-zsh.sh
@WeZZard
WeZZard / .vimrc
Last active February 7, 2023 15:35
vimrc
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'vim-syntastic/syntastic'
Plug 'keith/swift.vim'
//
// XCTestCase+AssertingThrows.h
//
//
// Created by WeZZard on 29/05/2017.
//
//
#import <XCTest/XCTest.h>