Skip to content

Instantly share code, notes, and snippets.

View dartokloning's full-sized avatar

Darto KLoning dartokloning

View GitHub Profile
@dartokloning
dartokloning / pdo-wrapper.php
Created May 5, 2020 17:41 — forked from eimg/pdo-wrapper.php
Simple yet secure PHP PDO database wrapper with CRUD methods...
<?php
# PDO Wrapper, supporting MySQL and Sqlite
# Usage:
# $db = new db();
#
# // table, data
# $db->create('users', array(
# 'fname' => 'john',
# 'lname' => 'doe'
# ));
@dartokloning
dartokloning / strong-passwords.php
Created November 24, 2019 16:30 — forked from compermisos/strong-passwords.php
A user friendly, strong password generator PHP function.
#!/usr/bin/php
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
@dartokloning
dartokloning / Activate Office 2019 for macOS VoL.md
Created October 8, 2019 05:41 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@dartokloning
dartokloning / my.cnf
Last active March 18, 2021 16:37 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on cPanel/WHM servers)
# Optimized my.cnf configuration for MySQL/MariaSQL on cPanel/WHM servers
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated May 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
@dartokloning
dartokloning / gw-gravity-forms-disable-submit.php
Created September 20, 2017 16:04 — forked from spivurno/gw-gravity-forms-disable-submit.php
Gravity Wiz // Gravity Forms // Disable Submit Button Until Required Fields are Field Out
<?php
/**
* Gravity Wiz // Gravity Forms // Disable Submit Button Until Required Fields are Field Out
*
* Disable submit buttones until all required fields have been filled out. Currently only supports single-page forms.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...

Add Sublime Text to OS X Context Menu

  • Open Automator
  • Create a new Service
  • Add a Run Shell Script action
  • Set input to Service receives selected files or folders in any application
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n $@
  • Set Pass input to as arguments
  • Save as Open in Sublime Text
@dartokloning
dartokloning / .bash_profile
Last active March 16, 2017 04:09
macOS Terminal with fancy styles
# Open Terminal and type nano .bash_profile
# Paste in the following lines:
########## start the configuration #############
# enable color prompt with fancy terminal title
export PS1="\[\e[31m\]┌\[\e[m\]\[\e[31m\]─\[\e[m\]\[\e[31m\]─\[\e[m\]\[\e[33m\][\[\e[m\]\[\e[35m\]\h\[\e[m\]:\w\[\e[33m\]]\[\e[m\][\d - \@]\n\[\e[31m\]└\[\e[m\]\[\e[31m\]─\[\e[m\]\[\e[31m\]─\[\e[m\]\[\e[37m\]>\[\e[m\]\[\e[37m\]>\[\e[m\]\[\e[36m\]\u\[\e[m\]\\$ "
# enable color ls output
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
@dartokloning
dartokloning / Aircrack Commands
Created March 6, 2017 09:34 — forked from victorreyesh/Aircrack Commands
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports.
//Install aircrack-ng:
sudo port install aircrack-ng
//Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
//Figure out which channel you need to sniff:
sudo airport -s
sudo airport en1 sniff [CHANNEL]
@dartokloning
dartokloning / gist:31becb113a9fe12822b614cf23ff8d04
Created February 15, 2017 15:02 — forked from reidransom/gist:6042016
Auto-starting VirtualBox VMs on OS X

Auto-starting VirtualBox VMs on OS X

After finding a lot of other posts on the topic that didn't work out for me this one did the trick so I'm reposting for my own sense of self preservation.

Link to original article.

Copy the Virtualbox autostart plist template file to your system's LaunchDaemons folder.

sudo cp \

/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist \

@dartokloning
dartokloning / php-html-css-js-minifier.php
Created January 16, 2017 07:54 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
// Based on <https://github.com/mecha-cms/extend.minify>
define('MINIFY_STRING', '"(?:[^"\\\]|\\\.)*"|\'(?:[^\'\\\]|\\\.)*\'');
define('MINIFY_COMMENT_CSS', '/\*[\s\S]*?\*/');
define('MINIFY_COMMENT_HTML', '<!\-{2}[\s\S]*?\-{2}>');
define('MINIFY_COMMENT_JS', '//[^\n]*');
define('MINIFY_PATTERN_JS', '\b/[^\n]+?/[gimuy]*\b');
define('MINIFY_HTML', '<[!/]?[a-zA-Z\d:.-]+[\s\S]*?>');