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 gclid = getParameterByName('gclid'); | |
function getParameterByName(name, url) { | |
if (!url) { | |
url = window.location.href; | |
} | |
name = name.replace(/[\[\]]/g, "\\$&"); | |
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | |
results = regex.exec(url); | |
if (!results) return null; |
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
# Force SSL and non-www | |
RewriteCond %{HTTP_HOST} ^(www\.)(.*) [NC] | |
RewriteRule (.*) https://%2%{REQUEST_URI} [R=301,L] |
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
$.fn.randomize = function (selector) { | |
var $elems = selector ? $(this).find(selector) : $(this).children(), | |
$parents = $elems.parent(); | |
$parents.each(function () { | |
$(this).children(selector).sort(function (childA, childB) { | |
// * Prevent last slide from being reordered | |
if($(childB).index() !== $(this).children(selector).length - 1) { | |
return Math.round(Math.random()) - 0.5; | |
} |
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 Illuminate\Support\Str; | |
/** | |
* Create a conversation slug. | |
* | |
* @param string $title | |
* @return string | |
*/ | |
public function makeSlugFromTitle($title) | |
{ |
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\Providers; | |
use Illuminate\Support\Collection; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |
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
> Usage | |
$recipient = array('[email protected]'); | |
$sender = array('[email protected]' => 'Account'); | |
$subject = 'Hello there'; | |
$templateName = "ThisIsTheExtbaseEmailTemplate"; // .html file | |
$content = array( | |
'firstname' => $postData['first_name'] | |
); |
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
> location.main | |
v1 | |
location /blog/ { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_pass http://127.0.0.1:2371; |
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
$update = \Stripe\Subscription::update($subscriptionId, [ | |
'billing_cycle_anchor' => 'now', | |
'proration_behavior' => 'always_invoice', | |
'proration_date' => strtotime('tomorrow 00:01'), | |
'default_tax_rates' => [$this->getCorrectTaxRateId($planID)], | |
'cancel_at_period_end' => false, | |
'items' => [ | |
[ | |
'id' => $subscription->items->data[0]->id, | |
'plan' => $planID |
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
COMPOSER_MEMORY_LIMIT=-1 composer require author/package |
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
<input type='tel' data-filter='[0-9|+]*' placeholder='123+456'> | |
<input type='tel' data-filter='(\+|(\+[1-9])?[0-9]*)' placeholder='+10123'> | |
<input type='text' data-filter='([A-Z]?|[A-Z][a-z]*)' placeholder='Abcdefg'> | |
<input type='text' data-filter='([A-Z]{0,3}|[A-Z]{3}[0-9]*)' placeholder='ABC123'> | |
--- | |
// Apply filter to all inputs with data-filter: | |
let inputs = document.querySelectorAll('input[data-filter]'); |