Skip to content

Instantly share code, notes, and snippets.

View ronanguilloux's full-sized avatar

Ronan Guilloux ronanguilloux

View GitHub Profile
@ronanguilloux
ronanguilloux / gist:15014d7d1febe8c5b54a
Created June 10, 2015 13:15
gzip HTTP responses when possible
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/x-component
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/richtext
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE text/plain
@ronanguilloux
ronanguilloux / chmod
Created May 29, 2015 12:37
Chmoding web app executable files
find ~/releases -type d -exec chmod 750 {} \;
find ~/releases -type f -exec chmod 640 {} \;
<html>
<head>
<!-- ribbon credit credit goes to https://unindented.org/articles/github-ribbon-using-css-transforms/ -->
<style>
.ribbon {
//background-color: #a00;
background-color: #1EBA57;
overflow: hidden;
white-space: nowrap;
@ronanguilloux
ronanguilloux / submission.md
Last active March 11, 2016 20:05
sabre-vobject/issues/227, Apple's bug report submission

#Detect mobile device in PHP

Set an Environment Variable HTTP_IS_MOBILE to 1 if it matches any of the user agent

SetEnvIfNoCase User-Agent android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile HTTP_IS_MOBILE=1

Then :

resourceTypes:
- collection:
usage: This resourceType should be used for any collection of items.
description: The collection of <<resourcePathName>>
get:
description: Get all <<resourcePathName>>
responses:
200:
body:
schema: <<resourcePathName>>
@ronanguilloux
ronanguilloux / google-based-dms.raml
Created February 18, 2015 09:43
DMS Raml definition
#%RAML 0.8
title: GoogleDMS
version: 1.0.0
baseUri: http://dms.preprod.lespolypodes.com
documentation:
- title: Home
content: |
Welcome to the _Google-based DMS_ Documentation. The _Google-based DMS_
allows you to connect your application to a collection of files
hosted in a shared, protected Google Drive folder.
@ronanguilloux
ronanguilloux / fixing_notOnlyUTF8_MysqlTable.sh
Last active August 29, 2015 14:10
Fixing latin1, non-utf8 chars in an utf8 MySQL table
#source: http://stackoverflow.com/a/4462765/490589
mysqldump -h DB_HOST -u DB_USER -p DB_PASSWORD --opt --quote-names \
--skip-set-charset --default-character-set=latin1 DB_NAME > DB_NAME-dump.sql
mysql -h DB_HOST -u DB_USER -p DB_PASSWORD \
--default-character-set=utf8 DB_NAME < DB_NAME-dump.sql
@ronanguilloux
ronanguilloux / simpleServer.js
Created November 17, 2014 22:45
Damn Simple NodeJs Server demo
/*
* server.js
* Copyright (C) 2014 ronan <ronan@MacBook-Pro-de-Ronan.local>
*
* Distributed under terms of the MIT license.
*/
// $ npm install connect
// $ npm install serve-static
// $ node simpleServer.js
@ronanguilloux
ronanguilloux / poorManPatch.sh
Last active August 29, 2015 14:09
Create a "patch" folder from a git diff. This is not a .patch to use with `diff`, this is just a folder with all modified subfolders & files
#
# poorManPatch.sh - a Poor man's not-a-patch alternative solution,
# when no git/patch/diff are available in a production environment.
#
# This is not a .patch file generator (to use with `diff`):
# This just creates a ./patch folder with all modified subfolders & files
# between a tag or a branch and your current working copy.
#
# Distributed under terms of the MIT license.
#