Contract Killer
The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
<?php | |
function strip_word_html($text, $allowed_tags = '<b><i><sup><sub><em><strong><u><br>') | |
{ | |
mb_regex_encoding('UTF-8'); | |
//replace MS special characters first | |
$search = array('/‘/u', '/’/u', '/“/u', '/”/u', '/—/u'); | |
$replace = array('\'', '\'', '"', '"', '-'); | |
$text = preg_replace($search, $replace, $text); | |
//make sure _all_ html entities are converted to the plain ascii equivalents - it appears | |
//in some MS headers, some html entities are encoded and some aren't |
<?php | |
# Insert code here |
... | |
location ~* \.(gif|jpg|jpeg|ico|png|svg)$ { | |
# Do jack shit. | |
} | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} |
I hereby claim:
To claim this, I am signing this object:
?php | |
class Prestashop1ValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri | |
* @return boolean |
?php | |
class Prestashop1ValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri | |
* @return boolean |
<?php | |
/* | |
* Various of other things going on up here. I slimmed down the code for readability, | |
* and focus. $companies is an array of .. companies .. gathered from an external API. | |
*/ | |
$companiesToCreate = collect([]); | |
foreach ( $companies as $company ) | |
{ |
Okay, so basically what I'm trying to do, is gather Companies and Employees from an external API. For the purpose of this, I'll call the API objects:
In my database, I also have Companies and Employees. I'll name them
Basically, I need to sync the external data, with the internal.
Vue.http.headers.common['X-CSRF-TOKEN'] = Laravel.csrfToken; | |
Vue.http.interceptors.push((request, next) => { | |
request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken); | |
next(); | |
}); | |
// I tried both of these approaches (even at the same time??) | |
// It even sends the token with the request, yet it still fails |