Skip to content

Instantly share code, notes, and snippets.

@gitfer
gitfer / Ajax call after async
Last active December 16, 2020 20:47
Executes an ajax call after async functions are executed
var loader = {
load: function (aString, time, callback) {
setTimeout(function () {
console.log("long process...");
callback(aString);
}, time);
}
};
var strings = ["aaaa", "bbbb"];
@gitfer
gitfer / _grid-ie-calc.scss
Created March 1, 2019 09:10 — forked from robinloeffel/_grid-ie-calc.scss
Dynamic CSS Grid Items in Internet Explorer and Edge - https://rbnlffl.synology.me/grid-ie-calc
/*
This mixin allows us use CSS grid without having to think about
what -ms-grid-row/-ms-grid-column we have to assign to a grid element
for it to properly work on Internet Explorer and Edge.
It takes three arguments, the last one of which is optional. Specify the
maximum amount of items you want to have in your grid, when they should
break to the next line and, if you like, a grid-gap of some sort.
@gitfer
gitfer / web.config
Created February 7, 2019 09:09 — forked from maxan/web.config
IIS Config to React Router App
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
@gitfer
gitfer / Docker transmission LibreELEC.txt
Last active September 1, 2018 20:21
Docker transmission LibreELEC
1) STOPPARE E RIPULIRE TUTTO E CONTROLLARE DI AVERE SPAZIO SU DISCO (pulire /storage/.cache/core)
killall dockerd
killall docker
dockerd&
docker system prune
docker ps -a (deve tornare 0 container)
docker rmi libreelec/transmission
docker rmi <hash> (fino a quando "docker images -a" non ritorna 0 immagini)
killall dockerd
@gitfer
gitfer / Keeping a fork up to date
Last active July 14, 2018 13:32 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date
### 1. Clone your fork:
git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
### 2. Add remote from original repository in your forked repository:
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@gitfer
gitfer / txtSublimeText 3 packages
Last active December 26, 2017 11:09
SublimeText 3 packages
ESLint
ESLint Formatter
Sublimelinter
Sublimelinter-contrib-eslint
(Sublimelinter-jshint)
(Sublimelinter-html-tidy)
Babel
Babel-snippets
Emmet
@gitfer
gitfer / switchOutputAudio.sh
Created September 7, 2015 23:10
Swith between hdmi and analog speakers tuning volumes
#!/bin/bash
CURRENT_PROFILE=$(pacmd list-cards | grep "active profile" | cut -d ' ' -f 3-)
if [ "$CURRENT_PROFILE" = "<output:hdmi-stereo+input:analog-stereo>" ] ; then
# Imposto analog speaker
pacmd set-card-profile 0 "output:analog-stereo+input:analog-stereo"
pacmd set-sink-port "alsa_output.pci-0000_00_08.0.analog-stereo" analog-output-speaker
pacmd set-source-volume alsa_input.pci-0000_00_08.0.analog-stereo 5
@gitfer
gitfer / ripWithSubtitles.sh
Created September 26, 2014 10:10
ripWithSubtitles.sh
#!/bin/bash
command -v mencoder >/dev/null 2>&1 || { echo >&2 "I require mencoder but it's not installed. Aborting."; exit 1; }
command -v mplayer >/dev/null 2>&1 || { echo >&2 "I require mplayer but it's not installed. Aborting."; exit 1; }
if [[ $# -eq 0 ]]; then
echo "ripWithSubtitles.sh a.avi a.sub o.avi 1"
exit 1;
fi
IFS='%'
FILENAME=$1
@gitfer
gitfer / PrintScanWirelessLinux
Created July 5, 2014 10:07
Print/Scan wirelessly on linux
#!/bin/bash
# aggiunge addresses per stampa e scan wifi
#CUPS URI: hp:/net/Officejet_J4680_series?ip=192.168.1.7
#SANE URI: hpaio:/net/Officejet_J4680_series?ip=192.168.1.7
#HP Fax URI: hpfax:/net/Officejet_J4680_series?ip=192.168.1.7
# hp-makeuri 192.168.1.7
xsane hpaio:/net/Officejet_J4680_series?ip=192.168.1.7