This file contains hidden or 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 hidden or 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 sortString(&$s) { | |
| $s = str_split($s); | |
| sort($s); | |
| $s = implode($s); | |
| } | |
| // example usage prints: | |
| // 1223344789aaaaadddefffffhhhiillllnnoorrsssuuuuwyy | |
| $string = 'ouhlasfuywernhlasdfoulnarfiuyadf1234987234sdfailh'; |
This file contains hidden or 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 | |
| require_once('./spf30.php'); | |
| if (!empty($_POST)) { | |
| try { | |
| // this is an example of the form data before decryption | |
| var_dump($_POST); | |
| // run validation on the submitted email form | |
| spam::validate($_POST); |
This file contains hidden or 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
| // example one - remove class if a match is found at the beginning | |
| $elem = $('#elemToMatch'); | |
| $.each($elem.getMatchingClass('*=classBeginsWith_'), function() { | |
| $elem.removeClass(this); | |
| }); | |
| // example two - perform an action if a match is found at the end | |
| // note this is not a very good method for showing and hiding | |
| // child elements and is only used as an example | |
| $('#elemToMatch').click(function() { |
This file contains hidden or 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
| // output will go to domains_found.txt in the same directory | |
| php -f domain-name-finder.php | |
| // output will go to the file specified as well as domains_found.txt in the same directory | |
| php -f domain-name-finder.php > my-output-file.txt |
This file contains hidden or 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 hidden or 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
| <link rel="stylesheet" type="text/css" media="screen" href="http://www.yoursite.com/css/canvas.css?v=1.2" /> | |
| <div id="container"> | |
| <!-- AS AN EXAMPLE, WE'LL STYLE THE FB SHARE BUTTON --> | |
| <fb:share-button class="url" href="http://www.your-site-url.com" /> | |
| </div> |
This file contains hidden or 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
| console.time(); | |
| var str = ''; | |
| for (var i = 0; i < 1000; i++) { | |
| str += i; | |
| } | |
| console.timeEnd(); |
This file contains hidden or 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 hidden or 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`), |