Skip to content

Instantly share code, notes, and snippets.

View andreacampi's full-sized avatar

Andrea Campi andreacampi

  • Apple, inc
  • London, UK
View GitHub Profile
@andreacampi
andreacampi / config.php.erb
Created May 4, 2012 06:23
PHP application
<?php
var $db_host = '<%= @host %>';
var $db_type = '<%= @database['type'] %>';
var $db_name = '<%= @database['name'] %>';
@andreacampi
andreacampi / HOWTO
Created February 23, 2012 13:54
How to get the best score on an Oatmeal quiz
# navigate to the quiz with your favorite browser;
# open up a JavaScript console (e.g. Inspector if you use Safari / Chrome; Firebug if you use Firefox);
# paste the JavaScript snippet that you find below
@andreacampi
andreacampi / gist:1437973
Created December 6, 2011 12:05
TEST ./tests/v00036.vtc FAILED
# top TEST ./tests/v00034.vtc passed (0.553)
**** top 0.0 macro def varnishd=../varnishd/varnishd
**** top 0.0 macro def pwd=/usr/src/packages/BUILD/varnish-3.0.2/bin/varnishtest
**** top 0.0 macro def topbuild=/usr/src/packages/BUILD/varnish-3.0.2/bin/varnishtest/../..
**** top 0.0 macro def bad_ip=10.255.255.255
**** top 0.0 macro def tmpdir=/tmp/vtc.7037.6ff6e66c
* top 0.0 TEST ./tests/v00036.vtc starting
*** top 0.0 varnishtest
* top 0.0 TEST Test fallback director
*** top 0.0 server
package com.s*******e.sgw.be.servlet.utils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import com.s*******e.sgw.rest.auth.utils.AuthUtils;
public class CheckerUtils {
@andreacampi
andreacampi / gist:1270657
Created October 7, 2011 16:02
walkthrough
$curry-line-height: 22px;
$curry-plain-grid-outer-width: 280px;
$curry-plain-grid-margin: 25px;
$curry-plain-h2-font-size: 32px;
@import "curry/plain";
.controls {
background-color: #222;
base="https://raw.github.com/Treesaver/treesaver.walkthrough/master"
mkdir -p public
mkdir -p public/img
for a in 01-down-the-rabbit-hole.html resources.html treesaver-0.9.2.js
do
curl -o public/$a ${base}/$a
done
Exception c0000005, at 1EEE3416
Access violation: attempting to read memory at address 00000004
Native function stack data: 0,3f49c0,20201,801c6,65637845,6f697470,3063206e,30303030
@andreacampi
andreacampi / gist:1222137
Created September 16, 2011 13:31
Before
class Cookbooks < Application
before :authenticate_every
# ...
end
@andreacampi
andreacampi / gist:1222130
Created September 16, 2011 13:27
Quick tip: how to monkey-patch a Merb controller
Merb::BootLoader.after_app_loads do
class Cookbooks
before :authenticate_every, :only => [ :create, :update ]
end
end
<figure>
<div data-sizes="ad-half-600" class="dynamic-ad ad-half-600" height="600"></div>
<div data-sizes="ad-half-500" class="dynamic-ad ad-half-500" height="500"></div>
<div data-sizes="ad-half-400" class="dynamic-ad ad-half-400" height="400"></div>
</figure>