Skip to content

Instantly share code, notes, and snippets.

View masgeek's full-sized avatar
🪁
Adapting

Sammy M masgeek

🪁
Adapting
View GitHub Profile
@masgeek
masgeek / composer.json
Created October 8, 2025 08:58
local disk repo in composer
"repositories": [
{
"type": "path",
"url": "../laravel-health-checker",
"options": {
"symlink": true
}
}
],
  • #225

  • Add text under the title: “To provide tailored advice that suits your investment preferences, we ask how often you invest in new farm products or technologies. If you invest often, we will provide higher-risk, higher-return recommendations. If you prefer safer options, please indicate that you invest only rarely.”

  • Then change the choice option “Never” to “Rarely”.

  • For some reason the pop-up with the selection is yellowish with a submit button. Make it consistent with the previous screens. No need for a pop-up. There should not be a default option preselected.

@masgeek
masgeek / fuelrod.php
Created April 11, 2022 14:03
PHP API sample
<?php
//HTTP V1
$request = new HttpRequest();
$request->setUrl('https://api.tsobu.co.ke/v1/sms/single');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'Content-Type' => 'application/json'
]);
@masgeek
masgeek / packages.R
Created March 24, 2021 12:57
Install some R packages
install.packages("ggplot2")
install.packages("gridExtra")
install.packages("shiny")
install.packages("shinythemes")
install.packages("shiny")
install.packages("rintrojs")
install.packages("magrittr")
install.packages("shinyWidgets")
install.packages("colourpicker")
install.packages("plyr")
public function GetRegionCurrencies($applicant_id, $prog_type)
{
//$prog_type = str_replace(".", "", $prog_typeRaw);
$countriesModel = COUNTRIES::model()->findAllByAttributes(array(
'EA_COUNTRY' => 1
));
$regionalArray = array();
foreach ($countriesModel as $code) {
@masgeek
masgeek / HaversineDistance.java
Created October 28, 2020 05:15 — forked from vananth22/HaversineDistance.java
Java Implementation of Haversine Formula for distance calculation between two points
/**
* This is the implementation Haversine Distance Algorithm between two places
* @author ananth
* R = earth’s radius (mean radius = 6,371km)
Δlat = lat2− lat1
Δlong = long2− long1
a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2)
c = 2.atan2(√a, √(1−a))
d = R.c
*
ldpi mdpi hdpi xhdpi xxhdpi xxxhdpi
Launcher And Home 36*36 48*48 72*72 96*96 144*144 192*192
Toolbar And Tab 24*24 32*32 48*48 64*64 96*96 128*128
Notification 18*18 24*24 36*36 48*48 72*72 96*96
Background 240*320 320*480 480*800 768*1280 1080 *1920 1440*2560
@masgeek
masgeek / .gitconfig
Last active September 19, 2025 06:04
Git alias config
[safe]
directory = *
[user] # User information for Git commits
email =
name =
[core] # Core Git settings
ignorecase = false # Case-sensitive file tracking
@masgeek
masgeek / Android Privacy Policy Template
Created April 18, 2020 11:38 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@masgeek
masgeek / PrintHelper.java
Last active August 18, 2019 15:22
Read printer queue
/*
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* "The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the