Skip to content

Instantly share code, notes, and snippets.

@oxycoder
oxycoder / crontab
Last active February 20, 2023 06:38
DDNS Cloudflare
# Run script every hours
0 * * * * /ddns.sh
@oxycoder
oxycoder / connect.md
Last active October 30, 2021 08:53
MongoDB replicaset on Docker

Setup allow to connect mongo replicaset running inside docker from host machine.

Start

Production: docker compose up -d

Development: docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d

run init_replica.sh to setup mongodb replica after container start

@oxycoder
oxycoder / script.sh
Last active November 20, 2021 00:47
Build Clang 12 with Meson and conan Ubuntu 20.04
#! /bin/bash
echo "install requires tools"
sudo apt-get update
sudo apt-get install -y cmake libffi-dev libedit-dev swig git gcc g++ pkg-config ninja-build libxml2-dev python3-pip
echo "Download llvm source"
git clone --depth 1 https://github.com/llvm/llvm-project
cd llvm-project
@oxycoder
oxycoder / Readme.MD
Last active May 21, 2020 16:38
Export i18n from template and ts file for angular 9

To extract message, run following command:

yarn extract-i18n
@oxycoder
oxycoder / Dockerfile
Created December 4, 2019 06:41
LLVM 9 + CMake + MSSQL ODBC Docker image
# Check http://releases.llvm.org/download.html#9.0.0 for the latest available binaries
FROM ubuntu:18.04
# Make sure the image is updated, install some prerequisites,
# Download the latest version of Clang (official binary) for Ubuntu
# Extract the archive and add Clang to the PATH
RUN apt-get update && apt-get install -y --no-install-recommends \
gnupg \
ca-certificates \
openssl \
@oxycoder
oxycoder / XP365B.drv
Last active April 8, 2024 17:34
Drivers for XPrinter 365B on Mac / Linux
// Include standard font and media definitions
#include <font.defs>
#include <media.defs>
Copyright "Oxycoder"
Copyright "License: MIT"
// Reference document: https://www.cups.org/doc/ref-ppdcfile.html#CustomMedia
// Introduction: https://www.cups.org/doc/ppd-compiler.html
// PostScript Dev: https://www.cups.org/doc/postscript-driver.html
@oxycoder
oxycoder / readme.md
Created June 28, 2019 06:58
Build Boost 1.70.0 with Clang 8 / LLVM on windows
@oxycoder
oxycoder / main.cpp
Created May 30, 2019 07:01
C++ game loop
// Basic c++ game loop
// idea: Render without affected to game logic and input
int main()
{
bool hasFocus = true; // check if windows is focus and active
bool isMinimize = false; // check if windows is minized
DWORD currentTime = timeGetTime();
DWORD lastFrameTime = 0;
int fpsLimitWithFocused = 60;
int fpsLimitWithoutFocus = 15;
@oxycoder
oxycoder / Player.h
Created March 23, 2018 08:09
Convert C fixed char array to swift tuple and swift tuple to C char array
// Player.h
type struct Player {
char name[23];
int level;
} Player;
@oxycoder
oxycoder / AuthController.php
Last active April 27, 2019 06:58
Laravel 5.4 Customize Password Reset with DingoApi
<?php
use Illuminate\Support\Facades\Password;
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
class AuthController extends BaseController
{
protected $hasher;
public function __construct(HasherContract $hasher)
{
$this->hasher = $hasher;