Skip to content

Instantly share code, notes, and snippets.

View bluvertigo's full-sized avatar

Andrea Gentili bluvertigo

View GitHub Profile
@bluvertigo
bluvertigo / command.sh
Last active May 30, 2022 13:02
Stream ripper - Radio Record / Registrare radio
streamripper http://ice1.somafm.com/missioncontrol-128-mp3 -q 33
@bluvertigo
bluvertigo / edil.php
Last active September 8, 2017 13:36
FIX edilbank video
function get_video_homepage($youtube,$i) {
if( strpos($youtube[$i]->link, "youtube" ) != true) {
$html = '<div id="video_'. $i .'">
<div class="video-content">
<a target="_blank" href="'. $youtube[$i]->link . '" onclick="_gaq.push([\'_trackEvent\', \'Homepage Video\', \'Click Video - '. $youtube[$i]->title .'\']);">
<img class="schermo" height="53px" width="71px" src="http://img.youtube.com/vi/'. id_youtube($youtube[$i]->link) .'/default.jpg" />
</a>
</div>
<div>
<div class="descrizione">'. $youtube[$i]->title .'</div>
@bluvertigo
bluvertigo / convert.sh
Created March 21, 2017 11:04
Convert image - Convertire immagine
find . -iname '*.jpg' -exec bash -c "du -h '{}' && convert '{}' -resample 72 -resize "1200x800" '{}' && du -h '{}'" ';'
@bluvertigo
bluvertigo / rewrite.md
Created March 15, 2017 16:14
rewrite URL

Ho un file del tipo:

"/some-page" => "/"

"/some-other-page" => "/some-other/new-page"

Lo posso convertire utilizzando awk

@bluvertigo
bluvertigo / ln.sh
Created March 7, 2017 14:26
To create symlink /usr/bin/bar --> /opt/foo - creare link simbolico
ln -s /opt/foo /usr/bin/bar
@bluvertigo
bluvertigo / date-diff.js
Last active June 16, 2017 09:34
DateDiff - Differenza tra date
var date1 = new Date("2/1/2016"); // Mese, Giorno, Anno
var today = new Date("1/1/2016");
var timeDiff = today.getTime() - date1.getTime();
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
document.write(diffDays);
@bluvertigo
bluvertigo / shell.sh
Created November 28, 2016 22:31
mount image on linux
sudo mount.vboxsf INBOX /mnt/inbox_vbox
@bluvertigo
bluvertigo / file_size.md
Created November 3, 2016 16:31
Dimensioni file nella cartella / jpg total file size
du -shc $(find . -iname '*.jpg') | tail -n 1
@bluvertigo
bluvertigo / shell.md
Last active September 8, 2017 13:51
Script per modificare immagini e ridimensionarle
find . -iname '*.jpg' -exec bash -c "du -h '{}' && convert '{}' -resample 72 -resize "1200x800" '{}' && du -h '{}'" ';'

variante:

find . -iname '*.jpg' -exec bash -c "du -h '{}' && convert '{}' -resample 72 -resize 1200x1200\> '{}' && du -h '{}'" ';'
@bluvertigo
bluvertigo / capistrano.md
Created October 27, 2016 13:21
Capistrano deploy
bundle exec cap staging deploy