Skip to content

Instantly share code, notes, and snippets.

View vienzent's full-sized avatar
💭
💯

Vienzent Jan Lugar vienzent

💭
💯
View GitHub Profile
@vienzent
vienzent / concat.bat
Created October 13, 2024 16:18
concat videos using ffmpeg
@echo off
setlocal
rem Create a file list for FFmpeg
(
for %%f in (*.mp4) do echo file '%%f'
) > filelist.txt
rem Run FFmpeg to merge the videos
@vienzent
vienzent / .wslconfig
Created January 25, 2024 12:19
limit wsl resource
[wsl2]
memory=2GB # Limits VM memory in WSL 2 to 4 GB
processors=2 # Makes the WSL 2 VM use two virtual processors
# PS > Restart-Service LxssManager
@vienzent
vienzent / multireddit-link-generator.js
Last active January 6, 2023 05:11
Generates mutlireddit links preventing URL character limit
@vienzent
vienzent / API.md
Created October 1, 2021 13:25 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

Git Cheat Sheet

Basic commands

git init Creates a new git repository in the directory

git add <file name> Adds a specific file to staging

git add . or git add -A Adds the full directory and its contents to staging

<?php
/**
* Laravel Passport - Customize Token response.
*
* @author Messi89 OVERGEN <@messi89minou>
* @link https://github.com/messi89
*/
namespace App\Http\Controllers\Api;
use App\Models\User;
@vienzent
vienzent / log.php
Created November 9, 2019 01:30
PHP log snippets
<?php
public function logger_cli($message, $time = true) {
if(php_sapi_name() !== 'cli') return;
if($time)
{
$t = date(DATE_ATOM);
$message = "[{$t}] - {$message}";
}
mysql> create database new_db;
> mysqldump -uroot -proot old_db | mysql -u root -proot new_db
@vienzent
vienzent / code-review-checklist.md
Created March 6, 2019 23:57 — forked from nerandell/code-review-checklist.md
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
<?php
if (isset($_GET['seek'])) {
$seek = $_GET['seek'];
$lines = [];
$handle = fopen('error_log', 'rb');
if ($seek > 0) {
fseek($handle, $seek);
}