Skip to content

Instantly share code, notes, and snippets.

View einnar82's full-sized avatar
🎯
Doing nice things.

Rannie Ollit einnar82

🎯
Doing nice things.
View GitHub Profile
@einnar82
einnar82 / IERC20.sol
Last active August 15, 2022 11:46
ERC20 Token standard
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
@einnar82
einnar82 / Oci8ServiceProvider.php
Last active July 8, 2021 06:57
Override OCI_CRED_EXT error in laravel-oci8 by yajra
<?php
namespace App\Providers;
use Illuminate\Database\Connection;
use Yajra\Oci8\Oci8ServiceProvider as ServiceProvider;
use App\Connectors\OracleConnector as Connector;
use Yajra\Oci8\Oci8Connection;
class Oci8ServiceProvider extends ServiceProvider
@einnar82
einnar82 / ActivityLogController.php
Last active July 7, 2021 02:46
Pipeline Pattern in Laravel (Queries)
<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use App\Models\ActivityLog;
use App\QueryFilters\FilterByUser;
use Illuminate\Http\Request;
use Illuminate\Pipeline\Pipeline;
const axios = require('axios').default;
axios.interceptors.request.use(x => {
const headers = {
...x.headers.common,
...x.headers[x.method],
...x.headers
};
@einnar82
einnar82 / startup.sh
Created May 13, 2021 05:58
Get certificate authorities installed in Ubuntu Machine
awk -v cmd='openssl x509 -noout -subject' '
/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt
@einnar82
einnar82 / sqlsrv-php7.2.sh
Created May 10, 2021 06:33 — forked from LegitDongo/sqlsrv-php.sh
SQLSRV PHP 7.2 Drivers that work for Laravel Homestead
# Best if added to `after.sh` so that this gets run every time the box is provisioned
# composer won't be able to download updates with an active proxy, and will hang trying to get the newest file
# You may want to comment this out based on your network configuration
sudo bash -c 'echo "export NO_PROXY=*" >> ~/.profile'
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get install php7.2-dev php7.2-xml mcrypt php-pear php-mbstring unixodbc unixodbc-dev -y --allow-unauthenticated
@einnar82
einnar82 / startup.sh
Created May 10, 2021 02:39
Install lower version PHP
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
@einnar82
einnar82 / docker-compose.yml
Last active July 21, 2021 05:57
Kong DB Less config
version: "3.7"
services:
kong:
image: kong:latest
volumes:
- ./kong.yml:/usr/local/kong/declarative/kong.yml
environment:
- KONG_DATABASE=off
- KONG_DECLARATIVE_CONFIG=/usr/local/kong/declarative/kong.yml
- KONG_PROXY_ACCESS_LOG=/dev/stdout
@einnar82
einnar82 / .gitlab-ci.yml
Last active April 15, 2021 08:37
Dockerized Stateless Laravel Application in Cloud Run
image: docker:latest
stages:
- deploy
deploy:
stage: deploy
image: google/cloud-sdk
services:
- docker:dind
@einnar82
einnar82 / Cipher.php
Last active March 4, 2025 17:04
AES-256-CBC Encryption and Decryption in PHP
<?php
namespace App\Encryptions;
class Cipher
{
private $cipherKey;
const AES_METHOD = 'AES-256-CBC';