Skip to content

Instantly share code, notes, and snippets.

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

Bernard Parah b3h3rkz

🏠
Working from home
View GitHub Profile
@takinbo
takinbo / index.js
Created September 17, 2021 13:00
sample implementation of lnurl-pay and lightning address
const lnurl = require('lnurl')
const { v4: uuid4 } = require('uuid')
const express = require('express')
const { exec } = require('child_process')
const crypto = require('crypto')
const app = express()
const port = 7000
const users = ['godwin', 'bernard']
@Muhammad-Altabba
Muhammad-Altabba / Contract_calls.sol
Last active February 20, 2024 10:45 — forked from critesjosh/Contract_calls.sol
CALL vs CALLCODE vs DELEGATECALL in Solidity
pragma solidity ^0.5.0;
contract C1 {
uint public num;
address public sender;
function callSetNum(address c2, uint _num) public {
(bool res,) = c2.call(abi.encodePacked(bytes4(keccak256("setNum(uint256)")), _num));
if(!res) revert(); // C2's num is set
}
@b3h3rkz
b3h3rkz / Angular Cache
Last active June 3, 2018 17:40
Prevent angular app from caching
Developing apps with angularjs comes with it's own headaches, one of which is the caching of files in the browser.
As a developer you can make use of plugins like Classic Cache Killer or disable caching in devtools. You can't go around asking all
your users to clear their cache after every new update
After going through several SO posts and blogs, only one solution worked for me(based on my setup).
Using Nginx, I added this directive
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
}
@yetithefoot
yetithefoot / stuns
Last active October 17, 2024 21:42 — forked from zziuni/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
@danriti
danriti / gist:2869387
Created June 4, 2012 16:27
Generate user activation key for a Django user
"""
The activation key for the ``UserProfile`` will be a
SHA1 hash, generated from a combination of the ``User``'s
email and a random salt.
"""
salt = hashlib.sha1(str(random.random())).hexdigest()[:5]
email = user.email
if isinstance(email, unicode):