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 | |
/** | |
* @param $items | |
* @param $perPage | |
* @return \Illuminate\Pagination\LengthAwarePaginator | |
*/ | |
function custom_paginate($items, $perPage) | |
{ | |
$pageStart = request('page', 1); | |
$offSet = ($pageStart * $perPage) - $perPage; |
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 | |
/*{ | |
"destination_addresses" : [ "" ], | |
"origin_addresses" : [ "" ], | |
"rows" : [ | |
{ | |
"elements" : [{ | |
"distance" : { | |
"text" : "1.9 mi", | |
"value" : 3000 |
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 | |
/** | |
* Calculate how much a profile is completed | |
* | |
* @param $profile | |
* @return float|int | |
*/ | |
function calculate_profile($profile) | |
{ | |
if ( ! $profile) { |
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 | |
/** | |
* Return the possible enum values from the table and column | |
* | |
* @param $table | |
* @param $field | |
* @return array | |
*/ | |
function get_enum_values($table, $field) | |
{ |
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 | |
/** | |
* Sorting tabulate data | |
* | |
* @param $column | |
* @param $body | |
* @return string | |
*/ | |
function sort_column_by($column, $body) | |
{ |
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
<scheme name="Amir - Material" version="142" parent_scheme="Default"> | |
<option name="FONT_SCALE" value="1.0" /> | |
<option name="LINE_SPACING" value="1.5" /> | |
<option name="EDITOR_FONT_SIZE" value="12" /> | |
<option name="EDITOR_LIGATURES" value="true" /> | |
<option name="EDITOR_FONT_NAME" value="Fira Code" /> | |
<colors> | |
<option name="ADDED_LINES_COLOR" value="212c32" /> | |
<option name="ANNOTATIONS_COLOR" value="8b999f" /> | |
<option name="BORDER_LINES_COLOR" value="" /> |
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 | |
/* PHP */ /* JavaScript */ | |
mb_strpos($myEmail, '@'); myEmail.indexOf('@'); | |
str_replace('@', '[at]', $myEmail); myEmail.replace('@', '[at]'); | |
mb_substr($myEmail, 0, 5); myEmail.substr(0, 5); | |
mb_strlen($myEmail); myEmail.length; | |
(int) '10'; parseInt('10'); | |
array_key_exists('name', $user); 'name' in user; | |
in_array('Book 1', $userBooks); userBooks.includes('Book 1'); | |
time(); Date.now(); |
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
class Errors { | |
/** | |
* Create a new Errors instance. | |
*/ | |
constructor() { | |
this.errors = {}; | |
} | |
/** | |
* Determine if an errors exists for the given field. |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0.319563 0.371489 0.414287 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>FiraCode-Regular - 12.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>0.319563 0.371489 0.414287 1</string> |
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
/* | |
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
It will generate several classes such as: | |
.mr-10 which gives margin 10 pixels. | |
.pb-5 gives PADDING 5 pixels | |
The first letter is "m" or "p" for MARGIN or PADDING | |
Second letter is "t", "b", "l", or "r" for TOP, BOTTOM, LEFT, or RIGHT | |
Third letter is the number of spacing in pixels. Adjust the amounts generated by editing the $spaceamounts variable below. |