This was only tested on a partial SentinelOne installation on the High Sierra beta, where SentinelOne was never allowed to enable it's kernel extension.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gmailAutoarchive() { | |
var delayDays = 2; // will only impact emails more than 48h old | |
var maxDate = new Date(); | |
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time? | |
// Get all the threads labelled 'autoarchive' | |
var label = GmailApp.getUserLabelByName("autoarchive"); | |
var threads = label.getThreads(0, 400); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validator::add('isUnique', function($data, $params, $options) { | |
$model = $options['model']; | |
$field = $options['field']; | |
$key = $model::meta('key'); | |
$entity = $model::first(array('conditions' => array($field => $data))); | |
$identifier = isset($options['values'][$key]) ? $options['values'][$key] : null; | |
if ($entity && $entity->data() && $identifier == (string) $entity->$key) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ATTENTION: this is pseudocode alike! | |
// witten inside the gist textbox without php validation! | |
/** | |
* This is a models vutsom save method | |
* The models validation rules should contain at least one 'on' => 'publish' rule! | |
* | |
* @param Object $entity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Lithium: the most rad php framework | |
* | |
* @copyright Copyright 2011, Union of RAD (http://union-of-rad.org) | |
* @license http://opensource.org/licenses/bsd-license.php The BSD License | |
*/ | |
?> | |
<!doctype html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author 2011 weluse GmbH, Marc Schwering | |
*/ | |
use lithium\core\Environment; | |
Environment::is(function($request) { | |
$http_host = $request->env('HTTP_HOST'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* General info: | |
* Embed this code in your lithium (li3) app. | |
* At the end of the app\config\connections.php for example. | |
* | |
* Uncomment the var_dump lines OR use the lithium Logger Class | |
* Use/modify the first callback, if you just want to see the query array data. | |
* Use the second callback for dumping the raw sql data. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Inspect the message, and do a string conversion via print_r | |
* | |
* @author: 2011 weluse GmbH, Marc Schwering | |
*/ | |
Logger::applyFilter('write', function ($self, $params, $chain){ | |
$var = $params['message']; | |
if(is_array($var) || is_object($var)){ | |
$params['message'] = print_r($var,true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* General info: | |
* Embed this code in your lithium (li3) app. | |
* At the end of the app\config\connections.php for example. | |
* | |
* Uncomment the var_dump lines OR use the lithium Logger Class | |
* Use/modify the first callback, if you just want to see the query array data. | |
* Use the second callback for dumping the raw sql data. | |
* | |
* @author: 2011 weluse GmbH, Marc Schwering |
NewerOlder