Skip to content

Instantly share code, notes, and snippets.

Working 24/7 👍

Samuel Denis-D'Ortun sadortun

Working 24/7 👍
View GitHub Profile
sadortun / script.js
Created Dec 30, 2020 — forked from bushev/script.js
Remove duplicated files from Moments (Synology NAS)
View script.js
// Very fast-coded deduplication utility. It parses standard "Storage Analyzer" report and moves duplicated files to a separate folder.
// Requires "npm i csv-parse 'move-file"
'use strict';
const path = require('path')
const fs = require('fs')
const parse = require('csv-parse/lib/sync')
const moveFile = require('move-file');
# remove exited containers:
docker ps --filter status=dead --filter status=exited --filter status=created -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
docker volume ls -qf dangling=true | xargs -r docker volume rm
View webhook demo for Google spreadsheet onFormSubmit event
// Simple spreadsheet, with first sheet containing form submission repsonses
// when the form is submitted:
// 1) grab the latest response,
// 2) post it to a third party service via an HTTP POST
function testWebhook() {
var ss = SpreadsheetApp.openById(SPREADSHEET_ID);
var form=ss.getSheets()[0];
var lr=form.getLastRow();
var el=form.getRange(lr,2,1,1).getValue();
var t=el;
sadortun / examples.js
Created Oct 22, 2016 — forked from bryanhelmig/examples.js
EmailPie Samples
View examples.js
// An invalid domain.
"didyoumean": null,
"errors": [
"message": "No MX records found for the domain.",
"severity": 7
View mamp-xdebug-advanced-php.ini
sadortun / magnific-popup-deep-linking.js
Created Oct 28, 2015
Deep Linking with Magnificent popup
View magnific-popup-deep-linking.js
<script type="text/javascript">
function loadGalleryDeepLink()
var prefix = "#gallery-";
var h = location.hash;
if (document.g_magnific_hash_loaded === undefined && h.indexOf(prefix) === 0)
View gist:2c764176ed188afa5ba0
namespace Sonata\Bundle\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sonata\Bundle\DemoBundle\Model\MediaPreview;
use Symfony\Component\HttpFoundation\Request;
class DemoController extends Controller