Skip to content

Instantly share code, notes, and snippets.

View ByScripts's full-sized avatar

Thierry Goettelmann ByScripts

  • Byscripts
  • France
View GitHub Profile
@ByScripts
ByScripts / .bash_prompt
Last active October 9, 2015 07:37
Bash and Zsh prompt with Git support
# To use, download this file at the root of your home directory, than add :
# . .bash_prompt
# at the end of you .bashrc file
# Colors
LineColor="\e[0;36m"
GitNotOkColor="\e[1;31m"
GitOkColor="\e[0;32m"
RootLineColor=$GitNotOkColor
WorkingDirColor="\e[0;93m"
@ByScripts
ByScripts / updatemirrors.sh
Created August 28, 2012 08:19
Script to automate use of Pacman Mirrorlist Generator
#!/bin/sh
[ "$UID" != 0 ] && su=sudo
country='US'
url="http://www.archlinux.org/mirrorlist/?country=$country&protocol=ftp&protocol=http&ip_version=4&use_mirror_status=on"
tmpfile=$(mktemp --suffix=-mirrorlist)
# Get latest mirror list and save to tmpfile
@ByScripts
ByScripts / category.rb
Created January 13, 2013 16:36
Problem that I don't understand with Rails relations
# $ rails new foo
# $ cd foo
# $ rails generate model Category position:integer parent_id:integer name:string children_count:integer
# $ rake db:migrate
# Modified app/models/category.rb
class Category < ActiveRecord::Base
attr_accessible :position, :parent_id, :name
alias c=clear
alias ..='cd ..'
alias i='sudo apt-get install'
alias u='sudo apt-get update'
alias r='sudo apt-get remove'
alias ug='sudo apt-get upgrade'
alias dug='sudo apt-get upgrade'
alias ar='sudo apt-get autoremove'
alias updatedb='sudo updatedb'
alias psg='ps -ef | grep -i'
@ByScripts
ByScripts / userChrome.css
Last active May 26, 2016 20:50
Custom CSS for Firefox, to match Numix GTK theme.
/**
* Firefox custom CSS for Numix GTK Theme
* To use with Firefox Numix Theme : https://addons.mozilla.org/fr/firefox/addon/numix-gtk3theme/
* Better with Omnibar FIrefox Add-On : https://addons.mozilla.org/fr/firefox/addon/omnibar/
*/
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Awesomebar improvements */
#urlbar {
#!/usr/bin/env bash
###################################################################################
#
# /!\ WARNING /!\
#
# If you want to use this script, be sure to read all and adjust it to your needs
# For example, I add my name and my email adress to git global config, change it!
#
###################################################################################
abbr -a -U -- bci 'brew cask install'
abbr -a -U -- bi 'brew install'
abbr -a -U -- bs 'brew search'
abbr -a -U -- cr 'composer require'
abbr -a -U -- dc docker-compose
abbr -a -U -- dcd 'docker-compose down'
abbr -a -U -- dce 'docker-compose exec'
abbr -a -U -- dcep 'docker-compose exec php'
abbr -a -U -- dcepc 'docker-compose exec php bin/console'
abbr -a -U -- dcl 'docker-compose logs -f'