Skip to content

Instantly share code, notes, and snippets.

View AV4TAr's full-sized avatar

Diego Sapriza AV4TAr

View GitHub Profile
@AV4TAr
AV4TAr / pr.md
Created April 11, 2014 14:03 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Keybase proof

I hereby claim:

  • I am av4tar on github.
  • I am av4tar (https://keybase.io/av4tar) on keybase.
  • I have a public key whose fingerprint is 4EB6 DAA3 FE27 6E2C 3FF2 07E1 9285 1593 1ED1 2342

To claim this, I am signing this object:

RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
---
# firewall
- name: iptables rules in place
when: not dev_instance | bool
copy: src=iptables dest=/etc/sysconfig/iptables owner=root group=root mode=0644
notify: iptables is restarted
- name: iptables service disabled and stopped
when: dev_instance | bool
Feature: Job Offers CRUD
In order to get employees
As a job offerer
I want to manage my offers
Background:
Given I am logged in as job offerer
Scenario: Create new offer
Given I access the new offer page
@AV4TAr
AV4TAr / hello.world.js
Created February 5, 2011 15:02
Hello word on node.js
var sys = require('sys');
setTimeout(function(){
sys.puts('world');
}, 2000);
sys.puts('hello');
@AV4TAr
AV4TAr / sphinx.conf
Created August 1, 2011 23:27
standard sphinx.conf
# in sphinx.conf
source main
{
type = mysql
...
sql_query = SELECT id, title, body FROM documents
}
index main
{
@AV4TAr
AV4TAr / Zend_View_Helper_JavascriptHelper
Created August 3, 2011 15:04
Javascript Helper Zend Framework MVC
<?php
class Zend_View_Helper_JavascriptHelper extends Zend_View_Helper_Abstract
{
function javascriptHelper() {
$request = Zend_Controller_Front::getInstance()->getRequest();
$file_uri = 'js/' . $request->getControllerName() . '/' . $request->getActionName() . '.js';
if (file_exists($file_uri)) {
$this->view->headScript()->appendFile('/' . $file_uri);
}
@AV4TAr
AV4TAr / gist:1123578
Created August 3, 2011 19:39
sphinx delta counter table
CREATE TABLE sph_counter
(
counter_id INTEGER PRIMARY KEY NOT NULL,
max_doc_id INTEGER NOT NULL
);
@AV4TAr
AV4TAr / sphinx.conf
Created August 3, 2011 20:36
sphinx.com delta
source main
{
# ...
sql_query_pre = SET NAMES utf8
sql_query_pre = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM documents
sql_query = SELECT id, title, body FROM documents \
WHERE id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 )
}
source delta : main