This file contains 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 | |
// CSRF start | |
function store_in_session($key,$value) | |
{ | |
if(isset($_SESSION)){$_SESSION[$key]=$value;} | |
} | |
function unset_session($key) | |
{ | |
$_SESSION[$key]=' ';unset($_SESSION[$key]); |
This file contains 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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains 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
#!/usr/bin/perl | |
# | |
# 2014-11-19: dsoares | |
# also see https://metacpan.org/pod/File::Slurp | |
# | |
use strict; | |
use warnings; | |
use 5.010; |
I hereby claim:
- I am dsoares on github.
- I am dsoares (https://keybase.io/dsoares) on keybase.
- I have a public key whose fingerprint is A4AA CA49 E7B4 D472 B9F4 8361 2550 0CA2 E58D FC92
To claim this, I am signing this object:
This file contains 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 | |
class MyModel extends BaseMyModel | |
{ | |
public function hydrate($row, $startcol = 0, $rehydrate = false) | |
{ | |
try { | |
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; | |
$this->type = ($row[$startcol + 1] !== null) ? $row[$startcol + 1] : null; | |
$this->resetModified(); |
This file contains 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 | |
// Before: composer require monolog/monolog | |
// composer autoloader | |
require_once 'vendor/autoload.php'; | |
// Shortcuts for simpler usage | |
use \Monolog\Logger; | |
use \Monolog\Formatter\LineFormatter; | |
use \Monolog\Handler\StreamHandler; |
This document is based on this instructions: Installing AMC development version on macOS
UPDATE 2018-03-15
Comments were added to this gist with a method to install AMC with Homebrew. To choose your best installation option, please read them before installation.
OlderNewer