Skip to content

Instantly share code, notes, and snippets.

View jbudziak's full-sized avatar
🏠
Working from home

jerome budziak jbudziak

🏠
Working from home
View GitHub Profile
@mandiwise
mandiwise / Count lines in Git repo
Last active July 4, 2024 16:56
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
[user]
name = Matthias DUGUE
email = mdugue@clever-age.com
[color]
ui = auto
[alias]
st = status -sb
co = checkout
ci = commit
oops = commit --amend -C HEAD
@FabienSalles
FabienSalles / .gitconfig
Last active March 4, 2024 23:11
Git configuration
[alias]
st = status -sb
co = checkout
amend = commit --amend -C HEAD
lg = log --pretty=format:\"%C(yellow)%h %C(blue)%ad%C(red)%d %C(reset)%s%C(green) [%cn]\" --decorate --date=short
undo = reset --soft HEAD^
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
unchanged = update-index --assume-unchanged
[color]
ui = true
@opi
opi / gist:4193667
Created December 3, 2012 08:34
Drupal: Admin form for file
<?php
function mymodule_admin_image() {
$form = array();
// Image wrapper
$form['image_default'] = array(
'#type'=>'fieldset',
'#title' => "Image par defaut",
'#collapsible' => TRUE,
@EtienneRd
EtienneRd / gist:4134954
Created November 23, 2012 10:28
Drupal:Format download file link
/**
* Implements hook_field_formatter_info()
*/
function MYMODULE_field_formatter_info()
{
return array(
// Format de téléchargement de fichier
'MYMODULE_file_link' => array(
'label' => t('Download link'),
'field types' => array('file')
@opi
opi / gist:4024093
Created November 6, 2012 11:17
Add contextual link to block
<?php
// See http://dominiquedecooman.com/blog/drupal-7-tip-add-contextual-links-anything
// See http://drupal.org/node/1089922
// hook_menu
// Menu item must have 'context' set to MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE
function mymodule_menu() {
return array(
@opi
opi / gist:3972431
Created October 29, 2012 08:46
Drsuh commande to update site language domain
<?php
function MYMODULE_drush_command() {
$items = array();
$items['languages-domain'] = array(
'aliases' => array('lang-domain'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all.
'options' => array(
'domain' => 'Specify domain (local, dev, prod)',
@GoZOo
GoZOo / gitignore global mac
Created September 17, 2012 09:59
Gitignore global Mac
*~
.DS_Store
.idea
@opi
opi / drushrc.php
Created June 21, 2012 07:18
Drush RC file.
<?php
/**
* Shell Aliases
*/
$options['shell-aliases']['pull'] = '!git pull'; // We've all done it.
$options['shell-aliases']['pulldb'] = '!git pull && drush updatedb';
$options['shell-aliases']['noncore'] = 'pm-list --no-core';
$options['shell-aliases']['wipe'] = 'cache-clear all';
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 05:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname