Skip to content

Instantly share code, notes, and snippets.

View federicomichela's full-sized avatar
🎯
Focusing

Michela Federico federicomichela

🎯
Focusing
View GitHub Profile
import {createApp} from 'vue';
import App from './App.vue;
const requireComponent = require.context('./', true, /App[A-Z]\w+\.(vue/js/ts)$);
const app = createApp(App);
requireComponent.keys().forEach(filename => {
let baseComponentConfig = requireComponent(filename);
@federicomichela
federicomichela / rmDirr.sh
Created February 24, 2021 10:26
Find and remove folders recursively
find . -name $1 -exec rm -rf {} \;
@federicomichela
federicomichela / Git Remove Branches in bulk
Created March 7, 2020 08:05
Remove branches locally and remotely
# [ONLY LOCALLY]
git branch | grep "commonPrefix" | xargs git branch -d
# [ONLY REMOTELY]
git branch --remote | grep -v 'excludeBranch1' | grep -v 'excludeBranch2' | cut -b 10- | xargs git push --delete origin
@federicomichela
federicomichela / OutlookMailbox-mail_content
Created January 31, 2018 11:03
OutlookMailbox - parse mail content
function processHtmlBody(asyncResult) {
var hiddenURL = $(asyncResult.value).find(‘#x_hiddenURL’).text()
console.log(hiddenURL);
}
Office.context.mailbox.item.body.getAsync(“html”, processHtmlBody)
@federicomichela
federicomichela / BASH-list_processes_on_port
Created January 31, 2018 10:59
BASH - list processes on port
netstat -vanp tcp | grep <PORT>
@federicomichela
federicomichela / JINJA2-trans_tags_variables
Created January 31, 2018 10:58
JINJA2 - adding variables to trans tags
{% trans email=user_email %}User {{email}} unable to access!{% endtrans %}
@federicomichela
federicomichela / JINJIA2-macros
Created January 31, 2018 10:56
JINJA2 - Set conditional variables ( Macros )
{% macro _page_title() -%}
{% block page_title %}
{% if page_id == 'some-string' %}
{% trans %}Some String{% endtrans %}
{% elif page_id == 'some-other-string' %}
{% trans %}Some Other String{% endtrans %}
{% else %}
{% trans %}General String{% endtrans %}
{% endif %}
{% endblock %}
@federicomichela
federicomichela / GIT-rename_branch
Last active January 31, 2018 10:55
GIT - Rename branch
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@federicomichela
federicomichela / GIT-fetch_all_branches.txt
Last active January 31, 2018 10:54
GIT - fetch all branches
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done