Skip to content

Instantly share code, notes, and snippets.

View opicron's full-sized avatar

Robbert Langezaal opicron

View GitHub Profile
@Roy-Orbison
Roy-Orbison / import-from-dir.php
Last active May 21, 2023 09:08 — forked from joshcangit/folder-import.php
Import any .sql[.gz] file, from a specifiable directory, rather than only the default adminer.sql[.gz], with Adminer.
<?php
/**
* Import SQL files from a directory
*
* @author joshcangit, https://github.com/joshcangit
* @author Roy-Orbison, https://github.com/Roy-Orbison
*/
class AdminerImportFromDir {
@pedrolamas
pedrolamas / docker-iptables-fix.sh
Created August 18, 2020 19:32
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@atomkirk
atomkirk / ios-camera.html
Created March 13, 2020 04:49
iOS Safari Camera API
<video id="player" autoplay muted playsinline> </video>
<button id="capture">Capture</button>
<canvas id="canvas" width=320 height=240></canvas>
<script>
const player = document.getElementById('player');
const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');
const captureButton = document.getElementById('capture');
const constraints = {
@joshcangit
joshcangit / folder-import.php
Last active May 21, 2023 09:08
Import .sql database files from a folder into Adminer.
<?php
/**
* Import SQL files from a directory
*
* @author joshcangit, https://github.com/joshcangit
* @author Roy-Orbison, https://github.com/Roy-Orbison
*/
class AdminerImportFromFolder {
@richard087
richard087 / tokenReplace.bat
Last active April 15, 2024 09:53
Batch file to do a token replacement on a text file, in Windows.
@echo off
rem sourced from http://stackoverflow.com/questions/5273937/how-to-replace-substrings-in-windows-batch-file
setlocal enabledelayedexpansion
set INTEXTFILE=test.txt
set OUTTEXTFILE=test_out.txt
set SEARCHTEXT=bath
set REPLACETEXT=hello
set OUTPUTLINE=
for /f "tokens=1,* delims=¶" %%A in ( '"type %INTEXTFILE%"') do (