Skip to content

Instantly share code, notes, and snippets.

View darkterminal's full-sized avatar

Imam Ali Mustofa darkterminal

View GitHub Profile
@darkterminal
darkterminal / QRLogo.php
Created January 23, 2022 06:43 — forked from NTICompass/QRLogo.php
QR Code + Logo Generator
<?php
/**
* QR Code + Logo Generator
*
* http://labs.nticompassinc.com
*/
$data = isset($_GET['data']) ? $_GET['data'] : 'http://labs.nticompassinc.com';
$size = isset($_GET['size']) ? $_GET['size'] : '200x200';
$logo = isset($_GET['logo']) ? $_GET['logo'] : FALSE;

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@darkterminal
darkterminal / directprinting.php
Created August 29, 2021 21:33 — forked from anestan/directprinting.php
direct printing php dot matrix
<?php
//set printing option to raw
$tmpdir = sys_get_temp_dir(); # ambil direktori temporary untuk simpan file.
$file = tempnam($tmpdir, 'ctk'); # nama file temporary yang akan dicetak
$handle = fopen($file, 'w');
$condensed = Chr(27) . Chr(33) . Chr(4);
$bold1 = Chr(27) . Chr(69);
$bold0 = Chr(27) . Chr(70);
$initialized = chr(27).chr(64);
@darkterminal
darkterminal / License Sublime Text 3.2.2.md
Created April 8, 2021 16:01 — forked from nobojithalder/License Sublime Text 3.2.2.md
License for Sublime Text Version 3.2.2, Build 3211

If anyone's looking for a solution for licensing Sublime Text!

Here goes an easy tutorial on how to register, Sublime Text Version 3.2.2, Build 3211

  • Go to https://hexed.it/
  • Click on "Open file" and select "sublime_text.exe" executable file. [This 'sublime_text.exe' file should be located at C:\Program Files\Sublime Text 3]
  • Go to "Search" and in "Search for" field, search for "97 94 0D" and click "Search now" button.
  • One result will appear below, click on it.
@darkterminal
darkterminal / RecieptPrinter.php
Last active March 20, 2021 09:16
ESC/POS PHP Printer
<?php
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\PrintConnectors\DummyPrintConnector;
use Mike42\Escpos\Printer;
class RecieptPrinter {
/* Create divider */
protected $divider;
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
Options SymLinksIfOwnerMatch
DirectoryIndex index.php
<IfModule mod_php5.c>
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
</IfModule>
@darkterminal
darkterminal / pdf-example.blade.php
Created November 27, 2020 14:44 — forked from alfredoem/pdf-example.blade.php
Template for a invoice render with DomPDF
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aloha!</title>
<style type="text/css">
* {
font-family: Verdana, Arial, sans-serif;
}
@darkterminal
darkterminal / canvas2pdf.html
Last active November 23, 2020 05:47
Created by SnippLeaf.com
<!-- Srouce From: https://jsfiddle.net/user/marksalvania/fiddles/ -->
<!DOCTYPE html>
<html>
<head>
<title>Canvas2PDF</title>
<style>
body {
background: beige;
}
@darkterminal
darkterminal / imgbb-upload-helper.php
Created October 1, 2020 00:12
Host Image using imgbb.com and upload using this method
<?php
function imgbb_upload( $image, $filename, $key ) {
$cfile = new CURLFile(realpath($image));
$postfields = [
"key" => $key,
"image" => $cfile,
"name" => $filename
];
@darkterminal
darkterminal / EAN-13_example.php
Created July 16, 2020 16:31
Created by SnippLeaf.com
<?php
class EAN13 {
private $code = null;
private $prefix = false;
public function __construct ($prefix = false) {
$this->prefix = $prefix === false ? false : (string) $prefix;
}