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
server { | |
server_name symfony.localhost; | |
root /var/www/symfony/public; | |
location / { | |
try_files $uri @rewriteapp; | |
} | |
location @rewriteapp { | |
rewrite ^(.*)$ /index.php/$1 last; |
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
curl -O https://dl.google.com/go/go1.10.linux-amd64.tar.gz | |
tar -xvf go1.10.linux-amd64.tar.gz | |
mv go /usr/local | |
apt-get install nano | |
nano ~/.profile | |
#export PATH=$PATH:/usr/local/go/bin | |
source ~/.profile |
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 | |
echo '<h1>Coucou</h1>'; |
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 | |
namespace Xeonys\Tests\Features\Mock; | |
use Rezzza\CommandBus\Domain\CommandBusInterface; | |
use Rezzza\CommandBus\Domain\CommandInterface; | |
class CommandBusMock implements CommandBusInterface | |
{ | |
const FILENAME = 'async_queue'; |
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
foreach (debug_backtrace() as $debug) { | |
echo $debug['class'] . '::' . $debug['function'].'<br>'; | |
} | |
exit(); |
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
package main | |
import ( | |
"fmt" | |
"github.com/gorilla/securecookie" | |
"golang.org/x/crypto/bcrypt" | |
"log" | |
"net/http" | |
"time" | |
) |
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
func identifyUserFromForm(r *http.Request) User { | |
err := r.ParseForm() | |
email := r.Form.Get("email") | |
password := r.Form.Get("password") | |
du := User{} | |
u, err := du.FindOneUserByEmail(email) | |
if err != nil { | |
log.Fatal(err) |
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
const cookieName = "mycookiename" | |
var hashKey = []byte(securecookie.GenerateRandomKey(32)) | |
var blockKey = []byte(securecookie.GenerateRandomKey(32)) | |
var sc = securecookie.New(hashKey, blockKey) | |
func ReadCookieHandler(r *http.Request) bool { | |
if cookie, err := r.Cookie(cookieName); err == nil { | |
value := make(map[string]string) |
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
func checkAuth(h http.HandlerFunc) http.HandlerFunc { | |
return func(w http.ResponseWriter, r *http.Request) { | |
if ReadCookieHandler(r) { | |
h.ServeHTTP(w, r) | |
} else { | |
log.Printf("Not authorized %s", 401) | |
} | |
h.ServeHTTP(w, r) | |
} |
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
var MyModalConfirmation = { | |
myModalStringSelector: '#myModal', | |
hashConfirmationModal: null, | |
confirmationMessage: 'Certain ?', | |
form: null, | |
saveBtn: null, | |
isConfirmed: false, |