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
| /** | |
| #if (${STATIC} == "static") * @type ${STATIC} #end | |
| #if (${STATIC} != "static") * nonstatic #end | |
| * @name ${NAME} | |
| * @description ${CARET} | |
| #if (${PARAM_DOC} != "") ${PARAM_DOC} #end | |
| #if (${THROWS_DOC} != "") ${THROWS_DOC} #end |
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 | |
| //preferably in some repository class (or the model itself) | |
| // this assumes you prefix your relations consistently, ie 'public function relSomeRelation()' | |
| /** | |
| * @param string relation method delimiter | |
| * @return array relationship methods | |
| */ | |
| public function getRelationMethods($delimiter) |
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
| $('.activator').click(function() { | |
| var target = $('#'+$(this).data('target')); //returns data-target value | |
| if(target.attr('disabled')) | |
| { target.removeAttr('disabled'); } | |
| else target.attr({'disabled':'disabled'}); | |
| }); |
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
| //use a service - don't forget to namespace! | |
| abstract class Validator { | |
| protected $errors; | |
| public function validate($input) | |
| { | |
| $validator = Validator::make($input, static::$rules); | |
| if($validator->fails()) | |
| { | |
| $this->errors = $validator->messages(); |
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
| alias ..='cd ..' | |
| alias ...='cd ../..' | |
| alias ....='cd ../../..' | |
| alias .....='cd ../../../..' | |
| alias ......='cd ../../../../..' | |
| alias .......='cd ../../../../../..' | |
| alias ........='cd ../../../../../../..' | |
| alias .........='cd ../../../../../../../..' | |
| alias ..........='cd ../../../../../../../../..' | |
| alias .2='cd ../..' |
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
| _ |
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
| { | |
| "always_prompt_for_file_reload": true, | |
| "always_show_minimap_viewport": true, | |
| "bold_folder_labels": true, | |
| "caret_extra_top": 5, | |
| "caret_extra_width": 2, | |
| "caret_style": "blink", | |
| "color_scheme": "Packages/User/Monokai (SL).tmTheme", | |
| "draw_minimap_border": true, | |
| "fade_fold_buttons": false, |
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
| #! /bin/bash | |
| for f in */ | |
| do | |
| if [ -f $f/httpdocs/wp-includes/version.php ]; then | |
| g=$(grep wp_version $f/httpdocs/wp-includes/version.php | tail -1) | |
| echo $f - $g | |
| elif [ -f $f/webshare/wp-includes/version.php ]; then | |
| g=$(grep wp_version $f/webshare/wp-includes/version.php | tail -1) | |
| echo $f - $g |
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
| /* | |
| * @param $chars ALPHA | NUM | ALPHANUM | HEX | string | |
| * @param $length number | |
| * @return $rstring | |
| */ | |
| public function GetRandomString($chars, $length) | |
| { | |
| switch ($chars) { | |
| case "ALPHA": | |
| $chars = "abcdefghijklmnopqrstuvwxyz"; |
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
| static class Rot13 | |
| { | |
| /// <summary> | |
| /// Performs the ROT13 character rotation. | |
| /// </summary> | |
| public static string Transform(string value) | |
| { | |
| char[] array = value.ToCharArray(); | |
| for (int i = 0; i < array.Length; i++) | |
| { |