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
| function MyResponsiveComponent() { | |
| const width = useWindowWidth(); // Our custom Hook | |
| return ( | |
| <p>Window width is {width}</p> | |
| ); | |
| } |
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 | |
| class evidenceController { | |
| public function getDetails($id){ | |
| $course = Course::with(['courseType']) | |
| ->checkEstablishmentOnView() | |
| ->excludeArchived() | |
| ->findOrFail($id); | |
| $view = View::make('courses/parts/details') | |
| ->with('course', $course); |
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 | |
| namespace App\Http\Requests; | |
| use Illuminate\Foundation\Http\FormRequest; | |
| use Illuminate\Support\Facades\Auth; | |
| use Illuminate\Support\Facades\Hash; | |
| use Illuminate\Validation\Rule; | |
| class EditAccountRequest extends FormRequest |
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 | |
| REMOTE_URL="https://staging.example.com" | |
| LOCAL_URL="http://example.dev" | |
| REMOTE_PATH="/home/staging_example/public_html" | |
| LOCAL_PATH="/var/www/example.dev" | |
| SSH_HOST="user@staging.example.com" |
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 | |
| # | |
| # A small script that works like `cd` except that | |
| # it keeps cd-ing until it reachs the project root | |
| # project is defined by default as the directory | |
| # that contains a .git sub-directory. | |
| # | |
| # Change this behavior like this: | |
| # CDR_ROOT_ID=composer.json |
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
| <template> | |
| <select name="name" class="form-control" v-model="value"> | |
| <option :value="null" :selected="value === null">{{noProgrammer}} | |
| </option> | |
| <option v-for="(user_id, user_name) in apiProgrammers.data" | |
| :value="user_id" :selected="value == user_id" | |
| v-text="user_name"></option> | |
| </select> | |
| </template> |
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
| # make sure you only commit this file and int-call-codes-full-native-names to github | |
| import json | |
| def get_by_attr(test_list, attr, attr_val): | |
| for x in test_list: | |
| if x[attr] == attr_val: | |
| break | |
| else: | |
| x = None |
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
| var obj = {b: 3, c: 2, a: 1}; | |
| _.sortKeysBy(obj); | |
| // {a: 1, b: 3, c: 2} | |
| _.sortKeysBy(obj, function (value, key) { | |
| return value; | |
| }); | |
| // {a: 1, c: 2, b: 3} |
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
| <!-- country codes (ISO 3166) and Dial codes. --> | |
| <select name="countryCode" id=""> | |
| <option data-countryCode="GB" value="44" Selected>UK (+44)</option> | |
| <option data-countryCode="US" value="1">USA (+1)</option> | |
| <optgroup label="Other countries"> | |
| <option data-countryCode="DZ" value="213">Algeria (+213)</option> | |
| <option data-countryCode="AD" value="376">Andorra (+376)</option> | |
| <option data-countryCode="AO" value="244">Angola (+244)</option> | |
| <option data-countryCode="AI" value="1264">Anguilla (+1264)</option> | |
| <option data-countryCode="AG" value="1268">Antigua & Barbuda (+1268)</option> |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
NewerOlder