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
/* normal case */ | |
@font-face { | |
font-family: "DejaVu Sans"; | |
src: url(‘path-to-font-directory/DejaVuSans.eot’); | |
src: local(‘☺’), url("path-to-font-directory/DejaVuSans.ttf") format("truetype"); | |
} | |
/* bold */ | |
@font-face { | |
font-family: "DejaVu Sans"; |
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
<?php | |
/** | |
* Given a string containing any combination of YouTube and Vimeo video URLs in | |
* a variety of formats (iframe, shortened, etc), each separated by a line break, | |
* parse the video string and determine it's valid embeddable URL for usage in | |
* popular JavaScript lightbox plugins. | |
* | |
* In addition, this handler grabs both the maximize size and thumbnail versions | |
* of video images for your general consumption. In the case of Vimeo, you must | |
* have the ability to make remote calls using file_get_contents(), which may be |
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
<?php | |
function get_ip_address() { | |
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'); | |
foreach ($ip_keys as $key) { | |
if (array_key_exists($key, $_SERVER) === true) { | |
foreach (explode(',', $_SERVER[$key]) as $ip) { | |
// trim for safety measures | |
$ip = trim($ip); | |
// attempt to validate IP | |
if (validate_ip($ip)) { |
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
<?php | |
/** | |
* Handle calculating a percentage/fraction (proration) we should charge the | |
* user for based on the current day of the month before their next bill cycle. | |
* To use yourself, implement a getSubscription method which returns an object | |
* containing current_period_start and current_period_end DateTime objects. | |
* | |
* @access public | |
* @return float |
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
CREATE TABLE `secure_login` ( | |
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`email` VARCHAR(120) NOT NULL, | |
`password` VARCHAR(40) NOT NULL, | |
`session` VARCHAR(40) DEFAULT NULL, | |
`disabled` TINYINT(1) UNSIGNED DEFAULT 0, | |
`created_dt` DATETIME DEFAULT '0000-00-00 00:00:00', | |
`modified_ts` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | |
PRIMARY KEY (`id`), | |
UNIQUE INDEX `uniq_idx` (`email`) |
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 | |
##################################################### | |
# To run, simply: chmod +x medusa.sh && ./medusa.sh # | |
##################################################### | |
# Successful publickey connections | |
echo '==== Successful SSH Public Key Connections ====' | |
CONNECTIONS=`grep "sshd.*Accepted publickey" /var/log/auth.log` | |
while read -r line; do |
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
CREATE secure_login ( | |
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`email` VARCHAR(120) NOT NULL, | |
`salt` VARCHAR(8) NOT NULL, | |
`password` VARCHAR(40) NOT NULL, | |
`session` VARCHAR(40) DEFAULT NULL, | |
`disabled` TINYINT(1) UNSIGNED DEFAULT 0, | |
`created_dt` DATETIME DEFAULT '0000-00-00 00:00:00', | |
`modified_ts` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | |
PRIMARY KEY (`id`), |
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
<?php namespace App\Exceptions; | |
use Log; | |
use Mail; | |
use Config; | |
use Exception; | |
use Illuminate\Auth\Access\UnauthorizedException; | |
use Illuminate\Session\TokenMismatchException; | |
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |
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
<?php | |
// passed by reference | |
fixFilesArray($_FILES['fieldname']); | |
// all fixed | |
var_dump($_FILES['fieldname']); |
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
<?php | |
/** | |
* This code is intended to be added to your wp-config.php file just below the top comment block. | |
* It should replace the existing define('DB_*') statements. You can add or remove sections | |
* depending on the number of environments you intend to setup. You should change all values of | |
* DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST for each environment, making them all distinct | |
* for security purposes. | |
*/ | |
// determine the current environment |
NewerOlder