Skip to content

Instantly share code, notes, and snippets.

View Samshal's full-sized avatar
👨‍💻

Samuel Adeshina Samshal

👨‍💻
View GitHub Profile
function getNgrams($match, $n=3)
{
$ngrams = array();
$len = strlen($match);
for ($i = 0; $i < $len; $i++)
{
if ($i > ($n - 2))
{
$ng = '';
for($j = $n - 1; $j >= 0; $j--)
<?php
require "vendor/autoload.php";
$acl = new Samshal\Acl\Acl();
/**
* Create the roles and add them to the registry
*/
$acl->addRole("doctor");
USE [EmmetBlue]
GO
/****** Object: StoredProcedure [dbo].[CleanUpSchema] Script Date: 9/27/2016 8:07:51 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
<?php
try {
//send request to cardinity's server the normal way
}
catch(GuzzleHttp\Exception\ClientException $e){
//do something nice with $e. var_dump it to see its beauty
}
@Samshal
Samshal / analysis.sql
Created April 25, 2017 07:15
Pharmacy Statistics Analysis
BEGIN
DECLARE @sql TABLE(DispensationID INT, Patient INT, ItemID INT, DispensedQuantity INT, BillingTypeItemPrice MONEY, TotalPrice MONEY)
INSERT INTO @sql
SELECT a.DispensationID, a.Patient, b.ItemID, b.DispensedQuantity, c.BillingTypeItemPrice,
(b.DispensedQuantity * c.BillingTypeItemPrice) AS TotalPrice FROM Pharmacy.Dispensation a
INNER JOIN Pharmacy.DispensedItems b ON a.DispensationID = b.DispensationID
INNER JOIN Accounts.BillingTypeItemsPrices c ON b.ItemID = c.BillingTypeItem
INNER JOIN Accounts.BillingTypeItems d ON b.ItemID = d.BillingTypeItemID
WHERE d.BillingType = 7
<?php
$path = "c:/emmetblue/src/condra-setup";
$fileServer = "https://emmetblue.org.ng:702";
$globalsLocation = "c:/emmetblue/src/condra-setup/globals";
$apiPath = "c:/emmetblue/src/condra-setup/api";
$elasticSearchEndpoint = "http://35.227.118.101:9200";
$options = [
"dbconfig"=>[
<?php
function convertUtmToLatLong($north, $east, $utmZone){
// This is the lambda knot value in the reference
$LngOrigin = Deg2Rad($utmZone * 6 - 183);
// The following set of class constants define characteristics of the
// ellipsoid, as defined my the WGS84 datum. These values need to be
// changed if a different dataum is used.
@Samshal
Samshal / area.py
Last active September 24, 2020 12:46
#!/usr/bin/env python
# coding: utf-8
# This calculates the area of a raster by summing the squares
# of all pixel grids and grouping similar grids based on their rgb value
import rasterio
import os, sys
@Samshal
Samshal / switchCoords.php
Created March 14, 2021 06:38
Transform coordinates in a geojson from (long,lat) to (lat,long)
<?php
/*
* Transform coordinates in a geojson from (long,lat) to (lat,long)
*
* TOOLS: geojsonlint.com to validate geojson
*/
$file = file_get_contents("pipeline (1).geojson");
$file = json_decode($file);
Hello World