Skip to content

Instantly share code, notes, and snippets.

View kn9ts's full-sized avatar
🌠
I am one with the force!

Eugene Mutai kn9ts

🌠
I am one with the force!
View GitHub Profile
@kn9ts
kn9ts / GPLv3.md
Last active March 8, 2024 07:26
GPLv3 explained

GPL3 LICENSE SYNOPSIS

TL;DR* Here's what the license entails:

1. Anyone can copy, modify and distribute this software.
2. You have to include the license and copyright notice with each and every distribution.
3. You can use this software privately.
4. You can use this software for commercial purposes.
5. If you dare build your business solely from this code, you risk open-sourcing the whole code base.
[
{
"name": "",
"official_name_en": "Channel Islands",
"official_name_fr": "Îles Anglo-Normandes",
"ISO3166-1-Alpha-2": "",
"ISO3166-1-Alpha-3": "",
"M49": "830",
"ITU": "",
"MARC": "",
@kn9ts
kn9ts / composer_lower_section.json
Created June 1, 2015 16:42
Key parts in deploying a laravel application to dokku: composer.json
{
"scripts": {
"post-install-cmd": [
"php artisan optimize",
"chmod -Rvc 777 app/storage",
"chmod -R 777 public",
"php artisan cache:clear",
"php artisan migrate"
],
"post-update-cmd": [
@kn9ts
kn9ts / aws4_signing.py
Last active March 4, 2023 06:19
AWS V4 signing example in python
# AWS Version 4 signing example
#
# Example:
# Authorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/iam/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7
# Formulae:
# CanonicalRequest =
# HTTPRequestMethod + '\n' +
# CanonicalURI + '\n' +
# CanonicalQueryString + '\n' +
@kn9ts
kn9ts / soap-EandD.go
Created September 10, 2015 09:42
Decoding and encoding SOAP using Go (Awesomeness!!!)
package main
import (
"bytes"
"encoding/xml"
"fmt"
"github.com/webconnex/xmlutil"
"log"
//"net/http"
)
@kn9ts
kn9ts / vm_mpesa_api_readme.md
Last active April 9, 2022 06:32
Instructions to using the Vitumob Mpesa API
@kn9ts
kn9ts / in_array.go
Created July 16, 2015 06:57 — forked from anonymous/untitled
// Function to check if the the string given is in the array
inArray := func(str string, list []string) bool {
for _, v := range list {
if v == str {
return true
}
}
return false
}
@kn9ts
kn9ts / uuid.js
Created April 10, 2016 16:26
a light UUID generator (written in JS)
export default class UUID {
constructor() {
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
return uuid;
}
@kn9ts
kn9ts / shortsusd.js
Last active August 26, 2020 08:02
Short SUSD with USDC
const Web3 = require('web3');
const DSA = require('dsa-sdk');
const ETH_ADDRESS = 'XXXX';
const ADDRESS_PVT_KEY = 'XXXX'
const TARGET_ENDPOINT = 'https://mainnet.infura.io/v3/XXXX';
const mainnetP = new Web3.providers.HttpProvider(TARGET_ENDPOINT);
const web3 = new Web3(mainnetP);
const dsa = new DSA({
@kn9ts
kn9ts / inAppBrowserExample.js
Last active August 6, 2020 02:35
An InAppBrowser instance example
var browser = cordova.InAppBrowser.open('http://amazon.com?vitumob_session_id=13279njke12hjhuidhiush124hu', '_blank', 'location=no');
browser.addEventListener('loadstart', function(event) {
alert('Began loading this page: ' + JSON.stringify(event));
});
// event fires when the InAppBrowser finishes loading a URL.
browser.addEventListener('loadstop', function(event) {
// event => {type: 'loadstop', url: 'URL navigated to'}
// alert('InAppBrowser Event: ' + JSON.stringify(event));