This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Events { | |
bus: HTMLElement | |
constructor() { | |
this.bus = document.createElement('div') | |
} | |
on(event: string, callback: Function) { | |
this.bus.addEventListener(event, callback as EventListenerOrEventListenerObject) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Orphans.cID FROM Pages AS Orphans LEFT JOIN Pages AS Parents ON Orphans.cParentID = Parents.cID WHERE Parents.cID IS NULL AND Orphans.cID <> 1 AND Orphans.cIsSystemPage = 0 AND Orphans.cParentID <> 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i video-in.mp4 -vcodec libx264 -crf 34 video-out-compressed.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"10": ["165/70"], | |
"12": ["155/80"], | |
"13": [ | |
"155/80", | |
"175/70", | |
"175/80", | |
"185/60", | |
"185/70", | |
"185/80", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if command was ran as root. | |
if [[ $(id -u) -eq 0 ]]; then | |
echo "The command \"sphp\" should not be executed as root or via sudo directly." | |
echo "When a service requires root access, you will be prompted for a password as needed." | |
exit 1 | |
fi | |
# Usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* backup the db OR just a table | |
* See original: https://davidwalsh.name/backup-mysql-database-php | |
*/ | |
function backup_tables($host,$user,$pass,$name,$tables = '*') | |
{ | |
$link = mysqli_connect($host,$user,$pass,$name); | |
//get all of the tables | |
if($tables == '*') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Wire the trigger to show the file manager dialog | |
$('#addImageBtn').click(function () { | |
// Launch the dialog | |
ConcreteFileManager.launchDialog(function (data) { | |
// Parse the callback data to get more file detail | |
ConcreteFileManager.getFileDetails(data.fID, function(r) { | |
// Loop over each file and do whatever you want with it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery Password Complexity Meter | |
*/ | |
(function ($) { | |
$(document).ready(function () { | |
$('.check-complexity').complexify({minimumChars:6, strengthScaleFactor:0.3}, function(valid, complexity){ | |
$('.password-complexity > .progress-bar').css('width', complexity + '%'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# /etc/rc.d/init.d/supervisord | |
# | |
# Supervisor is a client/server system that | |
# allows its users to monitor and control a | |
# number of processes on UNIX-like operating | |
# systems. | |
# | |
# chkconfig: - 64 36 |
NewerOlder