Skip to content

Instantly share code, notes, and snippets.

View darkcolonist's full-sized avatar
🐣
I rise from the fire, stronger and brighter.

Christian Noel Reyes darkcolonist

🐣
I rise from the fire, stronger and brighter.
View GitHub Profile
@darkcolonist
darkcolonist / backup-mysql.bat
Last active June 1, 2020 09:08 — forked from merolhack/backup-mysql.bat
Windows: Backup all databases in a MySQL server.
@ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION
REM Windows Batch script to backup all mysql databases in a server
REM @author: Lenin Meza <lenin.meza.externo@prodecon.gob.mx>
REM Database information
SET dbhost="10.0.0.2"
SET dbuser="exporter"
@darkcolonist
darkcolonist / test.php
Last active April 6, 2017 09:43 — forked from anonymous/test.php
test
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$showHeader = true;
$firstRow = $result->fetch_assoc();
if ( true === $showHeader ) { // to achieve a 'single header'
$showHeader = false; // avoid other headers
echo 'Receipt #: ' . $firstRow[0]['info'] . '<br><br>';
echo 'Table #: ' . $firstRow['tid'] . '<br>';
<?php
/**
*
* Last version: https://gist.github.com/josecanciani/ff535426bd5d453ef9c2
*
* Credits (adapted from): https://gist.github.com/doubleking/6117215
*
**/
@darkcolonist
darkcolonist / include_dir.js
Last active September 10, 2015 09:03 — forked from kethinov/walksync.js
List all files in a directory in Node.js recursively in a synchronous fashion
/**
* include all js files in directory (node.js)
*
* each file included is concatenated to the file where it was included
* like in php
*/
var fs = require("fs");
function include_dir(dir, recurse, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);