Skip to content

Instantly share code, notes, and snippets.

@FabreFrederic
FabreFrederic / direction.ts
Last active October 19, 2016 15:06
Example of an enum class in Typescript. The enum returns a numeric value.
export enum Direction {
Left,
Right
}
@FabreFrederic
FabreFrederic / ImprovedDirection.ts
Last active October 26, 2016 07:35
Example of an enum class in Typescript. The enum returns a string value instead of a numeric value.
export enum ImprovedDirection {
Left = <any>'left',
Right = <any>'right'
}
@FabreFrederic
FabreFrederic / svnToGit
Last active September 26, 2016 06:43
Migrate to Git from SVN repository
# Example
git svn clone http://my.svn.com/myrepo
@FabreFrederic
FabreFrederic / delete git tag
Created September 6, 2016 14:36
Delete a local git tag
git tag -d tagname
@FabreFrederic
FabreFrederic / fred.zsh-theme
Last active August 29, 2016 12:13
My zsh theme file
# Based on the great ys theme (http://ysmood.org/wp/2013/03/my-ys-terminal-theme/)
# Machine name.
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
}
# Directory info.
local current_dir='${PWD/#$HOME/~}'
@FabreFrederic
FabreFrederic / git clone bare
Created August 4, 2016 15:50
How to clone a repository in a bare repository ?
git clone –mirror https://github.com/FabreFrederic/weatherStation.git
@FabreFrederic
FabreFrederic / getLargestFilesListFromRepository.sh
Last active September 6, 2016 14:43
Get the X largest files from your repository
#!/bin/sh
#
# Get the X largest files from your repository
# You have to pass the number of file you want
# The result is stored in the folder $folder
# foundList.txt is the list of largest files which are not deleted yet
# deletedList.txt is the list of largest files which are already deleted. They cannot be found in your workspace
#
#
@FabreFrederic
FabreFrederic / deleteLargestFilesFromRepository.sh
Last active September 6, 2016 14:41
Delete the files from your history repository
#!/bin/sh
#
# This script uses bfg-repo-cleaner
# https://rtyley.github.io/bfg-repo-cleaner
#
# Delete the files from your history repository
# The deleted files are listed in the $folder/deletedList.txt file
# You must run the getLargestFilesListFromRepository.sh script file before
#
@FabreFrederic
FabreFrederic / deleteBranchesBareRepository.sh
Created August 4, 2016 13:24
Delete all the branches except master and develop branches
# Delete all the branches except master and develop branches
git branch -D $(git branch | grep -Ev "(\*|master|develop)")
@FabreFrederic
FabreFrederic / filter-branch-new-repo-from-folder
Last active November 20, 2020 18:33
Splitting a subfolder out into a new repository
git filter-branch --prune-empty --subdirectory-filter my_folder_name