Skip to content

Instantly share code, notes, and snippets.

View drumer2142's full-sized avatar
:atom:

Fotis drumer2142

:atom:
View GitHub Profile
@drumer2142
drumer2142 / responses.go
Created April 20, 2020 19:26
Dynamic Error response calling respondJSON Func with the use of Interface for dynamic payload
package handler
import (
"encoding/json"
"net/http"
)
// respondJSON makes the response with payload as json format
func respondJSON(w http.ResponseWriter, status int, payload interface{}) {
response, err := json.Marshal(payload)
@drumer2142
drumer2142 / cipher.php
Created January 22, 2020 17:08
Basic PHP Encryption Algorithm
<?php
$toencrypt = 'The Big Blue House';
$key = 'dGVzdCB0ZXN0IHRlc3QgdGVzdA==';
$cipher = 'AES-128-CBC';