Skip to content

Instantly share code, notes, and snippets.

Chain FORWARD (policy DROP)
target prot opt source destination
DROP all -- anywhere anywhere ctstate INVALID
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
@saturday
saturday / sim.rb
Last active June 1, 2016 12:17
Simulate N-Back Data for Plots
def self.mega_team_plot_data(app_results)
results_by_task = {}
results_by_task["name"] = "Mega Team"
rng_0_back = Distribution::Normal.rng(70, 4).call
rng_1_back = Distribution::Normal.rng(60, 5).call
rng_2_back = Distribution::Normal.rng(50, 6).call
rng_3_back = Distribution::Normal.rng(30, 7).call
divisor = 600
* Adding handle: conn: 0x7ff280803a00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7ff280803a00) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying ::1...
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
# Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'
array(
(int) 0 => array(
'user_id' => '4f2951b0-0040-4b61-accf-596240c828e4',
'term' => ' #still',
'image_id' => '56',
'comment_id' => '176'
),
(int) 1 => array(
# Add Action in Controller
/**
* add method
*
* @return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Image->create();
/**
* Use the DS to separate the directories in other defines
*/
// This results in all webroot assets failing on windows via helpers, but when the path to say, an image is hardcoded and uses 'DS' those images are found.
if (!defined('DS')) {
define('DS', '/');
}
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
echo $this->Html->link(
$this->Html->tag('i', '', array('class' => 'icon-th')) .
' Image View',
array('action' => 'index', 'image'),
array('escape' => false)
);
<?php
/**
* This file is loaded automatically by the app/webroot/index.php file after core.php
*
* This file should load/create any application wide configuration settings, such as
* Caching, Logging, loading additional configuration files.
*
* You should also use this file to include any files that provide global functions/constants
* that your application uses.
*