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 / README.md
Created September 8, 2021 09:01 — forked from hakre/README.md

Extend from SoapClient Examples

Just a collection gist of some assorted example SOAPClients. Code must not be stable or useful under all circumstances, these are examples. Most of the code is outdated, so you won't need to use it any longer in production code. I've just collected and compiled this together out of interest, the information normally is scattered around.

If you need to a start with PHP's SOAPClient start with the PHP manual page of it and read through the comments as well. Double check with exisiting bug-reports if given as many things are fixed since a comment was left.

@einnar82
einnar82 / hmac-sha512.js
Created August 25, 2021 13:14
HMAC SHA512 Encryption
var crypto = require("crypto");
function encrypt(key, str) {
var hmac = crypto.createHmac("sha512", key);
var signed = hmac.update(new Buffer(str, 'utf-8')).digest("base64");
return signed
}
@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