Skip to content

Instantly share code, notes, and snippets.

Doing nice things.

Rannie Ollit einnar82

Doing nice things.
View GitHub Profile
einnar82 / QueryParameterSearchFilter
Created June 9, 2023 01:59
Query filter using request routes in Laravel
View QueryParameterSearchFilter
namespace App\Filters\Search;
use Closure;
use Illuminate\Support\Arr;
use Laravel\Scout\Builder;
class QueryParameterSearchFilter
einnar82 / config.txt
Created February 10, 2022 11:30
Docker config DNS
View config.txt
Just change the nameserver lines in /etc/resolv.conf to:
einnar82 / index.php
Created December 15, 2021 06:26
PHP refresher
View index.php
$name = 'rannie';
print $name;
function greetPerson($person)
// return '<br />hi '.$person;
return "<br />hi $person";
einnar82 / BaseRepository.php
Created November 21, 2021 07:25
Sample Repository Pattern for Laravel
View BaseRepository.php
namespace App\Repositories;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Pagination\Paginator;
abstract class BaseRepository
protected Model $model;
einnar82 / gist:4f8c3054448157db14daf608f35715be
Created October 25, 2021 07:23 — forked from kitek/gist:1579117
NodeJS create md5 hash from string
View gist:4f8c3054448157db14daf608f35715be
var data = "do shash'owania";
var crypto = require('crypto');
View file_owners.php
//answer for
class FileOwners
public static function groupByOwners($files)
foreach($files as $key=>$value)
einnar82 /
Created September 8, 2021 09:01 — forked from hakre/

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 / hmac-sha512.js
Created August 25, 2021 13:14
HMAC SHA512 Encryption
View hmac-sha512.js
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 / IERC20.sol
Last active August 15, 2022 11:46
ERC20 Token standard
View IERC20.sol
// 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 / Oci8ServiceProvider.php
Last active July 8, 2021 06:57
Override OCI_CRED_EXT error in laravel-oci8 by yajra
View Oci8ServiceProvider.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