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 | |
$cliArgs = getopt( | |
'', | |
[ | |
'help::', | |
'class-name:', | |
'class-path:', | |
'vendor-path::' | |
] |
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 MyBundle\Repository; | |
use Doctrine\ORM\EntityRepository; | |
use MyBundle\Doctrine\RepositoryTrait; | |
class MyRepository extends EntityRepository | |
{ | |
use RepositoryTrait; |
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
// Call by php-curl | |
bfw.bulton.fr:443 109.190.35.87 - - [10/Mar/2019:02:10:39 +0100] "GET /api/v4/users/bulton-fr/events?after=2018-03-04 HTTP/1.1" 400 3076 "-" "-" | |
// Call by shell_exec | |
gitlab.bulton.fr:443 109.190.35.87 - - [10/Mar/2019:02:10:39 +0100] "GET /api/v4/users/bulton-fr/events?after=2018-03-04 HTTP/1.1" 200 16304 "-" "curl/7.58.0" |
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 | |
/** | |
* I'm not the author of this, you can find this function on stackoverflow | |
* So a big thanks to the author, this function save me many times :) | |
* | |
* @link https://stackoverflow.com/questions/1057572/how-can-i-get-a-hex-dump-of-a-string-in-php | |
*/ | |
/** |
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
alias defeat "gensendmessage Stuck_Defeatme Activate" | |
alias killme "gensendmessage Stuck_Defeatme Activate" | |
alias pet "gensendmessage Pets_Summon_Unsummon_Button activate" | |
alias tp "gensendmessage Vipaction_Overworldmapteleport Activate" | |
alias ml "gensendMessage Vipaction_Mailbox Activate" | |
alias sceal "gensendmessage Vipaction_Sealvendor Activate" | |
alias shop "gensendmessage Vipaction_Professionvendor Activate" | |
alias bank "gensendmessage Vipaction_Bankvendor Activate" | |
alias cs gotoCharacterSelect | |
alias ah "gensendmessage Auction_Root 1" |
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 Foo | |
{ | |
public function bar() | |
{ | |
$class = get_called_class(); | |
var_dump($class); | |
return new $class('bar'); |
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 Foo { | |
use Bar; | |
class Foz { | |
public function run() { | |
return new Bar; | |
} | |
} |
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 | |
$exec = shell_exec('ps ax|grep myProcessName'); | |
$execList = explode("\n", $exec); | |
$processList = []; | |
foreach ($execList as $processLine) { | |
$matches = []; | |
if (preg_match('/(\d+) (.*) (S.*) (\d+:\d+) (.*)/', $processLine, $matches) === false) { | |
continue; |
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
//Remove liked suggest tweet | |
const allTweetSuggest = document.querySelectorAll('div[data-component-context="suggest_activity_tweet"]'); | |
const nbSuggest = allTweetSuggest.length; | |
let suggestTweet; | |
for (let suggestLoopIndex = 0; suggestLoopIndex < nbSuggest; suggestLoopIndex++) { | |
suggestTweet = allTweetSuggest[suggestLoopIndex]; | |
suggestTweet.parentNode.remove(); | |
} |
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 | |
NB_PAGES=28 #Replace by the number of the page for your account | |
ALL_PIDS="" | |
# Replace "yourValueHere" by your cookie value | |
COOKIES="loginemail=\"yourValueHere\";delavid=yourValueHere;H1:yourValueHere=1;sm_dapi_session_yourValueHere=1;delvisitor=\"yourValueHere\";session=yourValueHere" | |
AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36" | |
for PAGE in $(seq 1 $NB_PAGES) |
NewerOlder