Skip to content

Instantly share code, notes, and snippets.

View afonsoalban's full-sized avatar

Afonso Alban afonsoalban

View GitHub Profile
@afonsoalban
afonsoalban / block_personal_appts
Created November 30, 2021 20:50 — forked from ttrahan/block_personal_appts
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
var secondaryEvents=secondaryCal.getEvents(today,enddate);
const stopAllYouTubeVideos = () => {
const iframes = document.querySelectorAll("iframe")
Array.prototype.forEach.call(iframes, iframe => {
iframe.contentWindow.postMessage(
JSON.stringify({
event: "command",
func: "stopVideo",
}),
"*"
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
@afonsoalban
afonsoalban / download.sh
Last active March 22, 2018 14:08
Para baixar URLs que às vezes estão bloqueadas no navegador.
curl -o myfile.mp3 www.foo.com/bar.mp3
@afonsoalban
afonsoalban / multipleColumns.scss
Created September 22, 2015 12:52
SCSS snippets
@mixin columns($numberOfColumns, $margin){
$size: ($margin * ($numberOfColumns - 1) ) / $numberOfColumns;
float: left;
margin-left: $margin;
width: calc(#{100 / $numberOfColumns}% - #{$size});
&:nth-child(#{$numberOfColumns}n+1){
clear: left;
margin-left: 0;