Skip to content

Instantly share code, notes, and snippets.

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

Lucas Dasso Lukas238

🏠
Working from home
View GitHub Profile
@Lukas238
Lukas238 / git_shallow_clone_readme.md
Last active May 18, 2021 19:53
Git shallow clone a repo to use as website root

How to git clone a repo to be used on a web server

Objective

I want to clone the repo of my site on my server, and configure the webserver to point to the subfolder ./public/, inside the repo.

This will allow me, for example, to update the site from the repo by means of running the commant git pull --forceon the server.

Repository structure

@Lukas238
Lukas238 / Readme.md
Last active May 19, 2021 03:17
Toggl2jira Toggl.com companion

Toggl2jira Toggl.com companion

This script will remove the custom reserved tag "_logged" from any "continued" or "duplicated" time entry.

Use case

I usualy track my worked time in Toggl, but then report this info on Jira platform, as this is required by my job.

I keep track of already reported time entries by manualy adding them the tag "_logged". But some times I need to continue a task, but i dont want to bring the "_logged" tag to this new time entry.

@Lukas238
Lukas238 / Email On Acid_supported_devices_generator.md
Last active September 2, 2020 18:05
Email On Acid: Supported devices list generator

Email On Acid: Supported devices list generator

Navigate to the Email Test Settings page on Email On Acid, select a profile, and run this snipped on the browser developers console. The generated list will be a tab separated list, ready to be pasted on Excel.

var eoa_list = "";
$('#fieldset_all > fieldset').each((key,type)=>{
  $(type).find('> fieldset').each((key,device)=>{
		$(device).find('> label[aria-checked="true"]').each((key,os)=>{
@Lukas238
Lukas238 / bookmarklet
Last active August 26, 2020 06:05 — forked from thomaspark/bootswatchlet.js
Bootswatch bookmarklet - Updated 2020
javascript:(function(e%2Ca%2Cg%2Ch%2Cf%2Cc%2Cb%2Cd)%7Bif(!(f%3De.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc%3Da.createElement(%22script%22)%3Bc.type%3D%22text%2Fjavascript%22%3Bc.src%3D%22%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F%22%2Bg%2B%22%2Fjquery.min.js%22%3Bc.onload%3Dc.onreadystatechange%3Dfunction()%7Bif(!b%26%26(!(d%3Dthis.readyState)%7C%7Cd%3D%3D%22loaded%22%7C%7Cd%3D%3D%22complete%22))%7Bh((f%3De.jQuery).noConflict(1)%2Cb%3D1)%3Bf(c).remove()%7D%7D%3Ba.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window%2Cdocument%2C%221.3.2%22%2Cfunction(%24%2CL)%7Bif(%24(%22.bootswatcher%22)%5B0%5D)%7B%24(%22.bootswatcher%22).remove()%7Delse%7Bvar%20%24e%3D%24('%3Cselect%20class%3D%22bootswatcher%22%3E%3Coption%3Ecerulean%3C%2Foption%3E%3Coption%3Ecosmo%3C%2Foption%3E%3Coption%3Ecyborg%3C%2Foption%3E%3Coption%3Edarkly%3C%2Foption%3E%3Coption%3Eflatly%3C%2Foption%3E%3Coption%3Ejournal%3C%2Foption%3E%3Coption%3Elitera%3C%2Foption%3E%3Coption%3Elumen%3C%2Foption%3E%3Coption%3Elux%3C%2Foption%3E
@Lukas238
Lukas238 / SCSS media query and root class mixin.md
Last active July 15, 2020 15:40
SCSS media query and root class mixin

SCSS media query and root class mixin

This snipped shows hay to create a SCSS mixin to apply a group of properties as a Media Query, and also when the root element have a particular class.

Code Pen demo

Use case

As an example, imagine that you have a slider component that display 3 items on desktop view, and just 1 on mobile view. You can manage the styles using media queries for the mobile view.

@Lukas238
Lukas238 / readme.md
Created June 5, 2020 19:42
Jenkins to Teams Job Deploy notification Incomming Webhook

Jenkins to Teams Job Deploy notification Incomming Webhook

I wanted to have a Teams channel where to inform the team each time a deloy was successful.

Initialy I used the "Jenkins" connector, but found the posted information too generic. No branch nor commit number.

So I switched to use the "Incoming Webhook" connector, with allows me to create a Teams chat webhook URL to receive a JSON formated accordingly to the [Teams message card format], with whate ever information I requiere.

Then, in the Build section of the Jenkins Job, I added an "Execute Shell" build step, with the following code:

@Lukas238
Lukas238 / Batch group git tags by year.md
Last active September 17, 2020 20:34
Batch group git tags by year

This script will:

  1. Search for git tag with names starting with a the year 2018 followd by a hypen character (grep ^2018-).

Make sure to change the year in the script with the year you want to match.

  1. Then it will create a new tag using the year 2018/´followed by the origina tag name. Ex.: 2018/2018-01-20 Release 2.
  2. The it will delete the original tag.
git tag -l |grep ^2018- | while read t; do git tag "2018/"$t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done
@Lukas238
Lukas238 / 1_hyperv.bat
Created February 15, 2020 18:20
How to install Docker Desktop on Windows 10 Home edition and WSL2
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause
@Lukas238
Lukas238 / cloudSettings
Last active December 5, 2019 15:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-12-05T15:54:48.047Z","extensionVersion":"v3.4.3"}
@Lukas238
Lukas238 / .bashrc
Created October 25, 2019 03:02
.bashrc alias to launch Fork from WSL in Windows.
alias fork='/mnt/c/Windows/System32/cmd.exe /c "%USERPROFILE%\AppData\Local\Fork\Fork.exe "$(wslpath -w -a .)'