Skip to content

Instantly share code, notes, and snippets.

@andreav
andreav / git4f
Created September 19, 2012 12:24
git4f - git aliases for automate common every-day develop/integration operations with git (https://github.com/andreav/git4f/wiki)
# Copyright (C) 2012 Andrea Valle
#
# This file is part of git4f.
#
# git4f is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# git4f is distributed in the hope that it will be useful,
@andreav
andreav / .gitconfig-andreav
Last active March 12, 2020 10:05
my .gitconfig
[user]
email = andreav.pub@gmail.com
name = uallaualla
[color]
ui = true
interactive = auto
diff = auto
branch = auto
status = auto
[core]
@andreav
andreav / .aliases
Last active December 18, 2015 13:25
My .aliases
alias ls='ls --color=tty'
alias ll='ls -lah'
alias lll='ls -lahtr'
alias ff='find $( pwd ) -follow -name '
alias fic='find $( pwd ) -follow -name "*.c" -o -name "*.cc" -o -name "*.cpp" | xargs grep --color -e '
alias fih='find $( pwd ) -follow -name "*.h" | xargs grep --color -e '
alias fis='find $( pwd ) -follow -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.h" | xargs grep --color -e '
alias fif='find $( pwd ) -follow -type f -not -name "*~" -not -name "*swp" | xargs grep --color -e '
alias fip='find $( pwd ) -follow -name "*.py" | xargs grep --color -e '
@andreav
andreav / .bashrc
Last active March 29, 2018 16:30
My .bashrc hints
source /etc/bash_completion.d/git
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWBRANCHREMOTE=1
export GIT_PS1_SHOWUPSTREAM="verbose"
export PS1='\u@\h\[\e[1;32m\]$(__git_ps1 " %s")\[\e[m\] \w >'
@andreav
andreav / Failed to read file: private method `getc' called for #
Created January 7, 2013 11:12
Failed to read file: private method `getc' called for # referenced by issue at igloo15 / redmine_loader
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Project xmlns="http://schemas.microsoft.com/project">
<Name>Untitled</Name>
<Title>Untitled</Title>
<ScheduleFromStart>1</ScheduleFromStart>
<StartDate>2049-12-20T08:00:00</StartDate>
<FinishDate>2049-12-30T17:00:00</FinishDate>
<FYStartDate>1</FYStartDate>
<CriticalSlackLimit>0</CriticalSlackLimit>
<CurrencyDigits>2</CurrencyDigits>
@andreav
andreav / visual studio 2012 nunit integration
Last active December 10, 2015 22:18
Add external tool in Visual Studio to automatically launch NUnit on the current file
== LAUNCH NUnit FROM VS2012 ===========================================
TOOLS -> External Tool -> Add
Title: NUnit
Command: C:\path\to\nunit.exe
Arguments: $(TargetName)$(TargetExt)
Initial Directory: $(ProjectDir)\bin\Debug
TOOLS -> External Tool -> Add
@andreav
andreav / drupal7_pack_unpack_site_by_drush_and_bash
Last active December 11, 2015 04:29
drupal7_pack_unpack_site_by_drush_and_bash
refs: http://drupal.org/node/642116
refs: http://drupalovereasy.com/drupal-7/tutorials/installing-using-drush-make-git-profiles
refs: http://realize.be/exporting-more-configuration-drush-ctools-export-bonus
PACK:
# Starting from an up&running drupal site
#========================================
cd <drupal_repo_root>
@andreav
andreav / README
Last active December 11, 2015 04:38
drupal7 pack unpack bash scripts
>>>>> drupal7 pack unpack bash scripts <<<<<<<
* drupal7-install.sh is only used to install first time, and set right permissions
* copy drupal7-pack.sh drupal7-unpack.sh under "sites/all/custom/pack"
- work on your site from the UI
* run drupal7-pack.sh to export your repo to code, then commit and push
- Into another direcotory:
* clone your repo
@andreav
andreav / get_field_from_bundle
Last active December 11, 2015 21:38
My drupal 7 snippets
# refs - http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way
# refs - http://drupal.stackexchange.com/questions/25148/views-and-contextual-filters-with-entity-reference-field
========================================================
$output = field_view_field('node', $node, 'field_name');
========================================================
That will return the sanitised, rendered field in its entirety, in the current language and in render-array form, so you'll get all the associated markup.
It will use the sites language fallback logic if the field has no values available for the current language. You can also pass an array of formatter options or specify a view mode as an optional argument.
@andreav
andreav / .tmux.conf
Last active July 28, 2017 23:12
My tmux.conf and django-env-setup.sh
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %