Skip to content

Instantly share code, notes, and snippets.

View sadortun's full-sized avatar
🚑
Working 24/7 👍

Samuel Denis-D'Ortun sadortun

🚑
Working 24/7 👍
View GitHub Profile
@sadortun
sadortun / script.js
Created December 30, 2020 09:26 — forked from bushev/script.js
Remove duplicated files from Moments (Synology NAS)
// 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');
#!/bin/bash
# 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
// 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
sadortun / examples.js
Created October 22, 2016 06:33 — forked from bryanhelmig/examples.js
EmailPie Samples
// An invalid domain.
// http://emailpie.com/v1/[email protected]
{
"didyoumean": null,
"errors": [
{
"message": "No MX records found for the domain.",
"severity": 7
}
@sadortun
sadortun / mamp-xdebug-advanced-php.ini
Created February 18, 2016 01:32
How To Setup PhpStorm, Xdebug, and MAMP for Debugging: http://manovotny.com/setup-phpstorm-xdebug-mamp-debugging
zend_extension="/Applications/MAMP/bin/php/php5.3.29/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.coverage_enable=1
xdebug.default_enable=1
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp"
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
@sadortun
sadortun / magnific-popup-deep-linking.js
Created October 28, 2015 04:19
Deep Linking with Magnificent popup
<script type="text/javascript">
function loadGalleryDeepLink()
{
var prefix = "#gallery-";
var h = location.hash;
if (document.g_magnific_hash_loaded === undefined && h.indexOf(prefix) === 0)
<?php
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
{