Skip to content

Instantly share code, notes, and snippets.

@notomato
notomato / reclaimWindows10.ps1
Created January 8, 2017 07:40 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
@notomato
notomato / front-end-forms.php
Created October 7, 2015 15:45
CMB2 front end forms - shortcode takes id of any metabox registered and outputs the appropriate frontend form.
<?php
// @todo post editing
/**
* Gets the cmb instance
*
* @param string $metabox_id The id of the metabox as it is registered with `new_cmb2_box` e.g. `architect`
* @return CMB2 object
*/
var ES = ES||{};
ES.conf = ES.conf||{};
ES.conf.property = 'foo';
ES.Views = {
render = function(template, data) {
}
};
{
"require": {
"slim/slim": "2.*",
"illuminate/database": "*",
"dhorrigan/capsule": "*"
}
}
<?php
use lithium\core\ErrorHandler;
use lithium\action\Response;
use lithium\net\http\Media;
use lithium\analysis\Debugger;
use lithium\analysis\Logger;
use lithium\core\Environment;
/**
<?php
/**
* Do a raw sql query.
*
* @param $sql
* @return \lithium\data\source\database\adapter\Pdo\Result
*/
public static function execute($sql) {
return static::connection()->invokeMethod('_execute', array($sql));
@notomato
notomato / BaseController.php
Created March 31, 2014 06:03
SSL redirection in lithium controller
<?php
/**
* Redirect to SSL if we are not in development mode.
*
* @param object $request
* @param array $params
* @param array $options
*
* @return object
@notomato
notomato / routes.php
Created December 4, 2013 04:28
Lithium, handling redirects in route config
// Permanent redirect of old product URLs.
Router::connect('/productdetails/{:id}', [], function($request) {
return new lithium\action\Response([
'location' => ['Products::view', 'id' => $request->params['id']],
'status' => 301
]);
});
// Permanent redirect of old user files
Router::connect('/userfiles/{:path}', [], function ($request) {
@notomato
notomato / wpmenus.html
Last active December 19, 2015 21:08 — forked from danblaker/wpmenus.html
<div class="nav-menu">
<ul>
<li class="current_page_item"><a href="http://wp-themes.com/" title="Home">Home</a></li>
<li class="page_item page-item-2"><a href="http://wp-themes.com/?page_id=2">About</a></li>
<li class="page_item page-item-46"><a href="http://wp-themes.com/?page_id=46">Parent Page</a>
<ul class="children">
<li class="page_item page-item-49"><a href="http://wp-themes.com/?page_id=49">Sub-page</a></li>
</ul>
</li>
</ul>
@notomato
notomato / gist:5210653
Created March 21, 2013 04:18
Custom validator example.
Validator::add('validShippingDate', function($value, $format, $options) {
$validDates = array(
date('Y-m-d', time()),
date('Y-m-d', time() + 60*60*24),
date('Y-m-d', time() + 2*60*60*24),
date('Y-m-d', time() + 3*60*60*24),
date('Y-m-d', time() + 4*60*60*24),
date('Y-m-d', time() + 5*60*60*24),
date('Y-m-d', time() + 6*60*60*24),
date('Y-m-d', time() + 7*60*60*24)