Skip to content

Instantly share code, notes, and snippets.

View crukundo's full-sized avatar
🏠
Working from home

Rukundo crukundo

🏠
Working from home
View GitHub Profile
@crukundo
crukundo / scidConverter.ts
Last active October 16, 2023 08:56 — forked from SeverinAlexB/scidConverter.ts
Lightning Network short channel id (CLN) to decimal id (LND) converter
/** By LnRouter.app */
function bitShift(n: number, shiftBy: number): number {
let base = n;
for (let i = 0; i < shiftBy; i++) {
base = base * 2;
}
return base;
}
/**
@crukundo
crukundo / Step 1: Create API User.MD
Created August 21, 2021 20:44 — forked from chaiwa-berian/Step 1: Create API User.MD
Testing MTN MoMo Collection API in Sandbox using Postman

A. Checklist

  • To create an API User, you need the following things in place: X-Reference-Id and Ocp-Apim-Subscription-Key

1. X-Reference-Id

  • This is used as User ID since the Sandbox is a Mock Environment so we kinda create our own ids and send them over to the sandbox so it can uniquely identify the user
  • Get the value for this here: https://www.uuidgenerator.net/api/version4
  • Remember to keep this safely as we will use it when configuring our POST request
  • Lets say you have your X-Reference-Id as: 9f92971b-cd2e-4feb-9053-0b14d53ac4f5

2. Ocp-Apim-Subscription-Key

  • Get this from the Primary or Secondary Key of your Collections | Enable remote collection of bills, fees or taxes subscription.
@crukundo
crukundo / gotham.md
Created April 17, 2021 16:01 — forked from mfd/ gotham.md
Gotham font
https://cdn.rawgit.com/mfd/f3d96ec7f0e8f034cc22ea73b3797b59/raw/856f1dbb8d807aabceb80b6d4f94b464df461b3e/gotham.css

<link rel="https://cdn.rawgit.com/mfd/f3d96ec7f0e8f034cc22ea73b3797b59/raw/856f1dbb8d807aabceb80b6d4f94b464df461b3e/gotham.css">

@crukundo
crukundo / views.py
Created July 30, 2020 23:06 — forked from alee/views.py
Django Discourse SSO endpoint adapted from https://meta.discourse.org/t/sso-example-for-django/14258 - depends on settings.py DISCOURSE_BASE_URL and DISCOURSE_SSO_SECRET
import base64
import hmac
import hashlib
from urllib import parse
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseBadRequest, HttpResponseRedirect
from django.conf import settings
@login_required
from django import forms
from django.contrib.auth.models import User
class UserProfileForm(forms.ModelForm):
class Meta:
model = User
fields = ['first_name', 'last_name', 'email']
@crukundo
crukundo / cbv_multiple_forms.html
Created April 29, 2020 11:46 — forked from badri/cbv_multiple_forms.html
Django multiple forms code with sample usage
{% extends "base.html" %}
{% block content %}
<form method="post">{% csrf_token %}
{{ forms.subscription }}
<input type="submit" value="Subscribe">
</form>
<form method="post">{% csrf_token %}
{{ forms.contact }}
<input type="submit" value="Send">