Skip to content

Instantly share code, notes, and snippets.

View masgeek's full-sized avatar
🪁
Adapting

Sammy M masgeek

🪁
Adapting
View GitHub Profile
<?php
// Resource: http://stackoverflow.com/questions/4329260/cross-platform-php-to-c-sharp-net-encryption-decryption-with-rijndael
$iv = "45287112549354892144548565456541";
$key = "anjueolkdiwpoida";
$clear = "2310296|340105";
$encrypted = "B/DrahtonRfOMOgkCTcZRcuOdlpc68uKrNp9oCBpchY=";
$block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
@masgeek
masgeek / index.php
Created June 7, 2017 06:58 — forked from abel-masila/index.php
A simple USSD registration application written in PHP
<?php
/* Simple sample USSD registration application
* USSD gateway that is being used is Africa's Talking USSD gateway
*/
// Print the response as plain text so that the gateway can read it
header('Content-type: text/plain');
/* local db configuration */
$dsn = 'mysql:dbname=dbname;host=127.0.0.1;'; //database name
<?php
/**
* Created by PhpStorm.
* User: smbar
* Date: 09-Aug-18
* Time: 10:12 AM
*/
/**
* @param $array
@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
@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 / .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
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 / 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
*
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 / 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")