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
async function writeAboutTest(prompt,keywords = 'vie,ce que',exemple= '1.', engine = "davinci-instruct-beta-v3") { //text-davinci-002 | |
let text = ""; | |
/* | |
1. intro | |
2. sous titre | |
content | |
sous titre | |
content | |
3. conclusion | |
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 js avec private vars | |
*/ | |
class Person { | |
name = ''; | |
//private vars | |
#age = 0; | |
#ageInDogYears = 0; | |
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 | |
/** | |
* Class Compress | |
*/ | |
class Compress { | |
// methode basique de compression utile pour html, css, js | |
public static function compress_inline($code) { | |
return preg_replace( | |
array( |
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 | |
function is_alive_bl($url,$on){ | |
if (function_exists('curl_init')) { | |
$ch = curl_init(); | |
$options = array( | |
CURLOPT_URL => $on, | |
CURLOPT_HEADER => false, | |
CURLOPT_RETURNTRANSFER => true, | |
//CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_MAXREDIRS => 3, |
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 | |
function getStringBetween($p_string, $p_from, $p_to, $p_multiple=false){ | |
//checking for valid main string | |
if (strlen($p_string) > 0) { | |
//checking for multiple strings | |
if ($p_multiple) { | |
// getting list of results by end delimiter | |
$result_list = explode($p_to, $p_string); | |
//looping through result list array | |
foreach ( $result_list AS $rlkey => $rlrow) { |
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 | |
function ggSuggest($word, $lang = 'fr', $spin = false){ | |
$word = urlencode(trim($word)); | |
$words = array(); | |
$apicall = ("https://www.google.com/complete/search?output=toolbar&q=$word"); | |
$result = utf8_encode(file_get_contents($apicall)); | |
$resp = simplexml_load_string($result); | |
if ($resp){ | |
foreach ($resp as $t) { |
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
function spin(txt){ | |
var matches = txt.match(/{([^{}]*)}/g); | |
if (!matches) return txt; | |
for (i in matches) { | |
spin = matches[i]+''; | |
ori_spin = spin; | |
spin = spin.replace("{", "").replace("}", ""); | |
spin_strs = spin.split('|'); | |
txt = txt.replace(ori_spin,spin_strs[Math.floor(Math.random() * spin_strs.length)]); |
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
function seo_name($title) { | |
return preg_replace('/[^a-z0-9_-]/i', '', strtolower(str_replace(' ', '-', trim($title)))); | |
} |
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 | |
header("Status: 301 Moved Permanently", false, 301); | |
header("Location: http://www.exemple.net/repertoire/page.php"); | |
exit(); |