Skip to content

Instantly share code, notes, and snippets.

View d-nm's full-sized avatar

Damien N. d-nm

  • DFX
  • Saint-Étienne
View GitHub Profile
@GrzegorzBandur
GrzegorzBandur / Readme.md
Last active January 23, 2022 09:54
RESTful API with Symfony 4.4 + FOSRestBundle + FOSOauthServerBundle + FOSUserBundle

RESTful API with Symfony 4.4 + FOSRestBundle + FOSOauthServerBundle + FOSUserBundle

To start writing RestFull API in symfony we will need bundles:

        "friendsofsymfony/oauth-server-bundle": "^1.6",
        "friendsofsymfony/rest-bundle": "^2.7",
        "friendsofsymfony/user-bundle": "^2.1",
        "jms/serializer-bundle": "^3.5",
        "nelmio/api-doc-bundle": "^3.5",
        "sensio/framework-extra-bundle": "^5.2",
        "symfony/apache-pack": "^1.0",
@sfponce
sfponce / List of ransomware extensions
Created July 4, 2018 06:14 — forked from CHEF-KOCH/List of ransomware extensions
List of ransomware extensions
File extensions appended to files:
.ecc, .ezz, .exx, .zzz, .xyz, .aaa, *.cryp1, .abc, .ccc, .vvv, *.zepto, .xxx, .ttt, .micro, .encrypted, .locked, .crypto, _crypt, .crinf, .r5a, .XRNT, .XTBL, .crypt, .R16M01D05, .pzdc, .good, .LOL!, .OMG!, .RDM, .RRK, .encryptedRSA, .crjoker, .EnCiPhErEd, .LeChiffre, .keybtc@inbox_com, .0x0, .bleep, .1999, .vault, .HA3, .toxcrypt, .magic, .SUPERCRYPT, .CTBL, .CTB2, .diablo6, .Lukitus, .locky or 6-7 length extension consisting of random characters.
Known ransom note files:
HELPDECRYPT.TXT, HELP_YOUR_FILES.TXT, HELP_TO_DECRYPT_YOUR_FILES.txt, RECOVERY_KEY.txt HELP_RESTORE_FILES.txt, HELP_RECOVER_FILES.txt, HELP_TO_SAVE_FILES.txt, DecryptAllFiles.txt DECRYPT_INSTRUCTIONS.TXT, INSTRUCCIONES_DESCIFRADO.TXT, How_To_Recover_Files.txt YOUR_FILES.HTML, YOUR_FILES.url, encryptor_raas_readme_liesmich.txt, Help_Decrypt.txt DECRYPT_INSTRUCTION.TXT, HOW_TO_DECRYPT_FILES.TXT, ReadDecryptFilesHere.txt, Coin.Locker.txt _secret_code.txt, About_Files.txt, Read.txt, ReadMe.txt, DECRYPT_ReadM
@nicanaca0
nicanaca0 / ImportProductsCommand.php
Last active May 1, 2024 11:05
Simple CSV Product importer for Sylius. Includes the product, the variant, channel pricing, taxons images and associations (1.0.0-beta.2)
<?php
namespace AppBundle\Command;
use Sylius\Component\Core\Model\ChannelPricingInterface;
use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Sylius\Component\Product\Model\ProductAssociationInterface;
use Sylius\Component\Product\Model\ProductAssociationTypeInterface;
use Sylius\Component\Taxonomy\Model\TaxonInterface;
<?php
namespace AppBundle\DataFixtures\Processor;
use Doctrine\ORM\EntityManager;
use Gedmo\Tool\Wrapper\AbstractWrapper;
use Gedmo\Translatable\Translatable;
use Gedmo\Translatable\TranslatableListener;
use Nelmio\Alice\ProcessorInterface;
#!/bin/bash
USER="root"
PASSWORD=""
FILES="/Users/tenold/Backups/MySQL/*"
for f in $FILES
do
echo "Processing $f file..."
@ygotthilf
ygotthilf / jwtRS256.sh
Last active March 23, 2026 01:32
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@tripflex
tripflex / remove-span-tags-from-html.php
Last active December 3, 2021 10:26
Remove a specific span tag from HTML while preserving/keeping the inside content using PHP and DOMDocument
<?php
$content = '<span style="font-family: helvetica; font-size: 12pt;"><div>asdf</div><span>TWO</span>Business owners are fearful of leading. They would rather follow the leader than embrace a bold move that challenges their confidence. </span>';
$dom = new DOMDocument();
// Use LIBXML for preventing output of doctype, <html>, and <body> tags
$dom->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$xpath = new DOMXPath($dom);
@BaptisteDixneuf
BaptisteDixneuf / OVH_Public_Cloud_Storage_API_OpenStack_Swift.md
Created June 25, 2015 21:23
OVH Public Cloud Object Storage et API OpenStack Swift
@jakzal
jakzal / crawler-edit.php
Last active January 22, 2024 13:18
Removing nodes with DomCrawler
<?php
<<<CONFIG
packages:
- "symfony/dom-crawler: ~2.3"
- "symfony/css-selector: ~2.3"
CONFIG;
use Symfony\Component\DomCrawler\Crawler;
$html = <<<HTML
@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active September 23, 2025 16:12
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :