Skip to content

Instantly share code, notes, and snippets.

View zrod's full-sized avatar
💻
Refactoring https://donating.io

Rodrigo zrod

💻
Refactoring https://donating.io
View GitHub Profile
<?php
$resultSetMapping = new ResultSetMapping();
$resultSetMapping->addEntityResult('MyAppBundle:Phone', 'p');
$resultSetMapping->addFieldResult('p', 'id', 'id');
$resultSetMapping->addFieldResult('p', 'master_id', 'masterId');
$resultSetMapping->addFieldResult('p', 'slug', 'slug');
$resultSetMapping->addFieldResult('p', 'price', 'price');
$resultSetMapping->addFieldResult('p', 'name', 'name');
$query = $this->getEntityManager()->createNativeQuery('
# Replaces PgUp with Home
xmodmap -e "keycode 112 = Home NoSymbol Home"; xmodmap -e "keycode 110 = Prior NoSymbol Prior"
# Replaces PgDn with End
xmodmap -e "keycode 117 = End NoSymbol End"; xmodmap -e "keycode 115 = Next NoSymbol Next"
# Apply changes
xmodmap -pke > .Xmodmap
cd ~
echo "xmodmap .Xmodmap" > .xinitrc
@zrod
zrod / php-br.py
Created May 11, 2015 17:57
php-br.py modulo para willie
# coding=utf8
"""
php-br.py - Pega informacoes do www.php-br.org
"""
from __future__ import unicode_literals
import json
import willie.web as web
import willie.module
@willie.module.commands('artigo')
$ cat /etc/X11/xorg.conf.d/51-trackpoint.conf
Section "InputClass"
Identifier "evdev pointer catchall"
Driver "evdev"
Option "EmulateWheel" "1"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "0"
Option "XAxisMapping" "6 7"
Option "YAcisMapping" "4 5"
[
{
"class": "sidebar_label",
"font.bold": false,
"font.face": "Lucida Grande",
"font.size": 11
},
{
"class": "sidebar_label",
"parents": [{"class": "tree_row", "attributes": ["expandable"]}],
@zrod
zrod / placeholder.fallback.js
Created November 4, 2011 16:41
Placeholder fallback (HMTL 5)
/*
* Small workaround to support the 'placeholder' attribute found on HTML5's input elements.
* This version requires jquery 1.6+
*/
var myScript = ( function( $ ) {
function placeHolderFallback() {
var forms = $( 'form' );
if ( forms.length > 0 ) {
@zrod
zrod / ieSelectFixedWidth.js
Created November 17, 2011 13:33
Fixed width for IE Select elements (< 9)
$(document).ready(function() {
if ($.browser.msie && $.browser.version.charAt(0) < 9) myScript.ieSelectFixedWidth('select.mini, select.medium');
}
// ...
var myScript = {
ieSelectFixedWidth: function(el) {
$(el).each(function(k, v) {
var obj = $(v);
@zrod
zrod / gist:1861309
Created February 18, 2012 23:22
Magento - nginx config
# Magento
server {
listen 80;
server_name store;
error_log /var/log/nginx/store.error_log;
root /home/rod/www/magento;
index index.php;
location / {
@zrod
zrod / jquery-pop.js
Created April 26, 2012 02:51
jQuery and pop
var selection = jQuery([ "item1", "item2", "item3" ]),
pop = [].pop;
console.log( pop.call( selection ), selection.length, selection[1] );
// output: "item3" 2 "item2"
@zrod
zrod / ttpopover.js
Created May 13, 2012 17:30
ttpopover.js - A small (and yet in dev) jQuery popover plugin
/**
* ttpopover.js v0.2
* TT PopOver plugin
* @author Rodrigo Z. Arthuso
*
* Requires jQuery 1.7+, mustache.js 0.5+
*
* @TODO Review update position on resize
*/