Skip to content

Instantly share code, notes, and snippets.

@oxycoder
oxycoder / Octal2Char.php
Last active August 25, 2023 20:01
Decode!
<?php
/*
Simple script to convert from Octal to character and character to Octal
Author: Oxycoder
Sample Octal: 127 150 141 164 040 160 150 171 163 151 143 151 163 164 040 162 145 155 141 162 153 145 144 072 040 042 107 157 144 040 151 163 040 163 165 142 164 154 145 054 040 142 165 164 040 150 145 040 151 163 040 156 157 164 040 155 141 154 151 143 151 157 165 163 042 077
Sample Char: W h a t p h y s i c i s t r e m a r k e d G o d i s s u b t l e b u t h e i s n o t m a l i c i o u s
*/
@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;
@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 / 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 / readme.md
Created June 28, 2019 06:58
Build Boost 1.70.0 with Clang 8 / LLVM on windows
@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 / 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 / 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 / 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 / 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