Skip to content

Instantly share code, notes, and snippets.

View sebastian-marinescu's full-sized avatar
🤓

Sebastian G. Marinescu sebastian-marinescu

🤓
View GitHub Profile
@sebastian-marinescu
sebastian-marinescu / .htaccess
Created December 3, 2018 15:31 — forked from benhuson/.htaccess
Disable HTTP Strict Transport Security (HSTS) in .htaccess
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=0; includeSubDomains; preload" env=HTTPS
</IfModule>
@sebastian-marinescu
sebastian-marinescu / Copy.gs
Created November 6, 2019 14:56 — forked from takvol/Copy.gs
Copy google spreadsheet with all protected ranges permissions
function Main() {
var template = DriveApp.getFileById('YOUR_SPREADSHEET_ID'); //template spreadsheet
var destination = DriveApp.getFolderById('COPY_DESTINATION_FOLDER_ID'); //the directory to copy the file into
var curDate = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "yyyy-MM-dd");
var copyName = template.getName() + ' copy ' + curDate; //the filename that should be applied to the new copy (e.g. "My spreadsheet copy 2019-08-24")
copyTemplate(template, copyName, destination);
}
/**
@sebastian-marinescu
sebastian-marinescu / plink-plonk.js
Created February 24, 2020 07:41 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@sebastian-marinescu
sebastian-marinescu / ModRestAuthController.php
Created December 28, 2020 18:35 — forked from nick2687/ModRestAuthController.php
This controller can be used with the modrestcontroller class to preform basic remote authentication through the modrestservice class (modx rest api). Should only be used over https as it requires the username & pass to be sent along as a url param.
<?php
/**
* Found at: Controllers/Box.php
*
* Handle requests to [URL]/Controllers/Box. Automagically handles CRUD (GET/POST/PUT/DELETE) for the xPDOObject class myBox.
*/
class MyControllerAuth extends modRestController {
public $classKey = 'modUser';
public $defaultSortField = 'id';
@sebastian-marinescu
sebastian-marinescu / modx-json-to-placeholders
Created September 17, 2022 02:49 — forked from jmaddington/modx-json-to-placeholders
Quick snippet to set placeholders from a JSON array. Made basically so I could create MIGXs inside MIGXS. There is little error checking are anything else at this point. Use at your own risk.
<?php
/**
* jsonToPlaceholders snippet for JM Customer Database extra
*
* Copyright 2013 by JM Addington jm@jmaddington.com
* Created on 04-28-2013
*
* @package jmc
*/