Skip to content

Instantly share code, notes, and snippets.

View renoirb's full-sized avatar

Renoir Boulanger renoirb

View GitHub Profile
@renoirb
renoirb / mdn-compat-original.json
Last active August 29, 2015 13:55
MDN Compatibility tables import snapshots. See worked out version via https://github.com/webplatform/mdn-compat-importer, in this gist: https://gist.github.com/renoirb/8809405
/**
* FULL import
**/
{
"https://developer.mozilla.org/en-US/docs/Gamepad": {
"desktop": {
"General support": {
"Chrome": {
"prefix": "21.0"
},
@renoirb
renoirb / compat-mdn.json
Last active August 29, 2015 13:56
MDN Compatibility tables import snapshots. See original data: https://gist.github.com/renoirb/8746058
This file has been truncated, but you can view the full file.
[
{
"breadcrumb": [
"Web",
"CSS",
":indeterminate"
],
"category": "css",
"contents": {
"desktop": {
@renoirb
renoirb / performance.conf
Created February 27, 2014 02:01
Making systematic variable configuration based on server provisioning.
{%- set ram_int = salt['grains.get']('mem_total', '1024') // 1024 -%}
{%- set max_clients = ram_int * 150 -%}
{%- if ram_int == 1 -%}
{%- set max_per_child = 1000 -%}
{%- elif ram_int == 2 -%}
{%- set max_per_child = 10000 -%}
{%- else -%}
{%- set max_per_child = 0 -%}
{%- endif -%}
# Edited by Salt Stack, generated with calculations
@renoirb
renoirb / TimeHelper.php
Created March 17, 2014 00:25
PHP Time Helper
<?php
namespace Renoir\Util;
// Specific
use \DateTime;
use \DateInterval;
/**
* Time helper utility
@renoirb
renoirb / ApiConverterHandler.md
Last active August 29, 2015 13:57
Read for `Content-Type` in request, hijacks response to format.

Convert into an API a Symfony2 response

You want to create an alternate way to serve your data from your controllers on a Symfony2 project.

How about adding one event listener to convert to JSON anything that is sent from a controller. To do this, your project has to have your controllers to return arrays of Doctrine2 Entities and also to leverage @Template and @Route.

If you already do, only insert this EventListener and ensure you have a dependency or two met (below). Note that except the Serializer, the other ones are not required, you would need to manually create the services in your project (not covered here).

Use

@renoirb
renoirb / .bowerrc
Last active August 29, 2015 13:57
Work In Progress to use Compass and Ruby in the project
{
"directory": "./src/files/bower_components"
}
@renoirb
renoirb / keybase.md
Created March 27, 2014 15:55
keybase auth

Keybase proof

I hereby claim:

  • I am renoirb on github.
  • I am renoirb (https://keybase.io/renoirb) on keybase.
  • I have a public key whose fingerprint is 783E 74CE 1042 6F9F 2E2C 572A BC06 4BAD 27BF 89C1

To claim this, I am signing this object:

@renoirb
renoirb / snippet.html
Created March 31, 2014 15:28
Add WebPlatform Docs Annotations to any document
<script>
(function () {
var ssl = !! document.location.protocol.match(/^https:/),
embedUrl = 'http://notes.webplatform.org/app/embed.js';
if (ssl && !embedUrl.match(/^https:/)) {
var msg = ['Sorry, but this service is unavailable on pages ',
'served with HTTPS at this time. Please contact support for ',
'further assistance.'];
@renoirb
renoirb / INSTALLING_WEBPLATFORM_DOCS_MEDIAWIKI.md
Created April 1, 2014 21:38
Installing WebPlatform Docs MediaWiki

Installing WebPlatform Docs Mediawiki

Extensions

NOTE: Need to find the original repositories and/or make them available (with attributions to authors) on a git repository.

  • LookupUser
  • Narayam
  • EditSectionIcon
  • NoTOC
  • NewSignupPage