Skip to content

Instantly share code, notes, and snippets.

View lepfsd's full-sized avatar
🏠
Working from home

fsd lepfsd

🏠
Working from home
View GitHub Profile
@lepfsd
lepfsd / .hyper.js
Last active May 6, 2020 16:14
.hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@james2doyle
james2doyle / simple-json-reponse.php
Last active March 7, 2024 06:02
A simple JSON response function for PHP. Used in various PhileCMS plugins.
<?php
function json_response($code = 200, $message = null)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900");
@webdevilopers
webdevilopers / ContractController.php
Last active March 11, 2020 09:00
Symfony Event Listener to send html mail using SwiftMailer and Twig
<?php
namespace Acme\Bundle\ContractBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ContractController extends Controller
{
public function eventAction(Contract $contract)
{
$event = new ContractEvent($contract);