Skip to content

Instantly share code, notes, and snippets.

View ichtrojan's full-sized avatar
🔺
The Nothing

Michael Okoh ichtrojan

🔺
The Nothing
View GitHub Profile
package helpers
import (
"fmt"
"math"
"strings"
)
func HideEmail(email string) string {
em := strings.Split(email, "@")
@ichtrojan
ichtrojan / index.html
Created April 27, 2021 14:25
theater demo
<!DOCTYPE html>
<html lang="en">
<head>
<title>Thepeer test</title>
<style>
.p-5 {
padding: 5em;
}
</style>
<script type="application/javascript" src="https://money.thepeer.co/send.js"></script>
SELECT setval('users_id_seq', (SELECT MAX(id) from "users"));
"*":
core:
themes: [
"atom-material-ui"
"material-palenight-syntax"
]
editor:
fontFamily: "Dank Mono"
fontSize: 17
"exception-reporting":
<?php
function encryption($payload)
{
$key = $this->getkey($this->secretKey);
return $this->encrypt3Des($payload, $key);
}
function getKey($seckey)
{
@ichtrojan
ichtrojan / postgres_laravel_fix.sql
Created July 8, 2020 13:31
Script to fix postgres migration issues with Laravel
DO $$
DECLARE
rec RECORD;
LAST_ID integer;
BEGIN
FOR rec IN SELECT
table_name
FROM information_schema.columns WHERE table_schema='public' and column_name='id' and data_type='integer'
LOOP
execute 'SELECT (id + 1) as id FROM ' || rec.table_name || ' ORDER BY id DESC LIMIT 1' into LAST_ID;
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt -y install php7.4
sudo apt-get install php-mbstring
sudo apt-get install php-zip
sudo apt-get install php-xml
sudo apt-get install php-mysql
server {
root /var/www/app/public;
index index.php;
server_name domain;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
@ichtrojan
ichtrojan / node_install.sh
Created June 23, 2020 14:38
Node Install
sudo apt update
cd ~
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
server {
server_name your_domain www.your_domain;
location / {
proxy_pass http://localhost:9990;
}
}