Skip to content

Instantly share code, notes, and snippets.

View olivierobert's full-sized avatar

Olivier Robert olivierobert

View GitHub Profile
@olivierobert
olivierobert / keybase.md
Created September 12, 2019 03:27
keybase.md

Keybase proof

I hereby claim:

  • I am olivierobert on github.
  • I am olivierobert (https://keybase.io/olivierobert) on keybase.
  • I have a public key ASCoJf9HbK60HbF5uzFpzW6-33LgdmXVEDyPXHOOyW1vAQo

To claim this, I am signing this object:

@olivierobert
olivierobert / rails http status codes
Created February 3, 2017 02:51 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@olivierobert
olivierobert / payment_form.html.slim
Created February 2, 2016 04:38
Braintree Hosted Fields
form#paymentForm
.form-group.row
.col-sm-6
label.form-control-label= t('checkout.card_list_title')
div
.checkout-card-types
img.card-visa src=image_url('card-visa.png') width='32' height='auto'
img.card-mastercard src=image_url('card-mastercard.png') width='32' height='auto'
.form-group.row
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
server {
listen 80;
server_name site.com;
root /var/www/magento;
fastcgi_read_timeout 1200;
fastcgi_connect_timeout 1200;
access_log /var/log/nginx/magento.log main;
error_log /var/log/nginx/magento.log;
@olivierobert
olivierobert / CI Detect Ajax
Created November 22, 2012 09:26
Code Igniter // Detect and return AJAX / JSON response
/** Within the controller method **/
// If this is an ajax request, then return a JSON string
if ( $this->input->is_ajax_request() ):
$this->output->set_content_type('application/json');
$this->output->set_output( json_encode($data) );
endif;
@olivierobert
olivierobert / gist:4070041
Created November 14, 2012 03:16 — forked from lincolnthree/gist:1204112
Bootstrap
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><link type="text/css" rel="stylesheet" href="/socialpm-web/javax.faces.resource/bootstrap.css.xhtml" /><link type="text/css" rel="stylesheet" href="/socialpm-web/javax.faces.resource/docs.css.xhtml" /><link type="text/css" rel="stylesheet" href="/socialpm-web/javax.faces.resource/prettify.css.xhtml" />
<title>SocialPM » New Project</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Cache-Control" content="must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="Mon, 1 Aug 1999 10:00:00 GMT" /><script type="text/javascript" src="/socialpm-web/javax.faces.resource/prettify.js.xhtml"></script><script type="text/javascript" src="/socialpm-web/javax.faces.resou
@olivierobert
olivierobert / gist:4066642
Created November 13, 2012 16:07 — forked from DrDurco/gist:1995290
CI: controller
<?php
class Blog extends CI_Controller {
public function __construct()
{
parent::__construct();
// Your own constructor code
}
}
@olivierobert
olivierobert / gist:4066639
Created November 13, 2012 16:07 — forked from etienne-snippet/gist:1993145
CI: Model
<?php
class User_model extends CI_Model {
function __construct()
{
parent::__construct();
}
}
@olivierobert
olivierobert / gist:4066609
Created November 13, 2012 16:03
JS - GA async
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);