Skip to content

Instantly share code, notes, and snippets.

View welcoMattic's full-sized avatar
👨‍💻

Mathieu Santostefano welcoMattic

👨‍💻
View GitHub Profile
@tashian
tashian / circle.yml
Last active August 24, 2017 07:47
Rails/Heroku CircleCI deploy script
checkout:
post:
- git submodule sync
- git submodule update --init # use submodules
deployment:
production:
branch: production
commands:
- ./bin/heroku_deploy.sh yerdle:
timeout: 300
@dhoko
dhoko / gist:c810679812d0585ef08c
Last active August 29, 2015 14:05
Github Emoji emoticons
javascript:(function(){function doRequest(url,cb){cb=cb||function(){};var xhr=new XMLHttpRequest;var requestUrl=url;xhr.open("GET",requestUrl,true);xhr.onreadystatechange=function(){var status;var data;if(xhr.readyState==4){status=xhr.status;if(status==200){cb(JSON.parse(xhr.responseText))}}};xhr.send()}var body=["<style>ul {margin:0; padding:0; text-align:center} li { display: inline-block; vertical-align: top; list-style: none; background: #eee; margin: 2em; border: 1px solid rgb(217, 217, 217); width: 15%;}</style><ul><!--"];var figure='--><li><figure><img src="%img%" alt=""><figcaption><b>:%txt%:</b></figcaption></figure></li><!--';doRequest("https://api.github.com/emojis",function(data){for(var key in data){body.push(figure.replace("%txt%",key).replace("%img%",data[key]))}body.push("--></ul>");document.body.innerHTML=body.join("")});})();
@paulirish
paulirish / bling.js
Last active May 26, 2025 20:31
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@damienalexandre
damienalexandre / DatabaseSchemaTest.php
Created October 9, 2015 10:17
Test doctrine schema automatically for missing / broken migrations.
<?php
namespace AppBundle\Tests;
use Doctrine\ORM\Tools\SchemaTool;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* Use Doctrine default entity manager and compare it's metadata to the actual database schema.
*
@lyrixx
lyrixx / run.php
Last active November 9, 2023 13:51
Updated your templates with the new twig include
<?php
<<<CONFIG
packages:
- "symfony/finder: ~3.0"
- "symfony/console: ~3.0"
CONFIG;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@Neirda24
Neirda24 / src\Rector\AddGenericToAbstractTypeRector.php
Created April 23, 2025 17:27
Rector rule to add the `@extends AbstractType<TData>` on forms based on `data_class`
<?php
declare(strict_types=1);
namespace Utils\Rector\Rector;
use PhpParser\Comment\Doc;
use PhpParser\Node;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Expr\Array_;