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
@leenswitts
leenswitts / uganda_district_hash.json
Created March 17, 2021 07:40
List Of Districts In Uganda In JSON Format
[
{ "name": "Abim" },
{ "name": "Adjumani" },
{ "name": "Agago" },
{ "name": "Alebtong" },
{ "name": "Amolatar" },
{ "name": "Amudat" },
{ "name": "Amuria" },
{ "name": "Amuru" },
{ "name": "Apac" },
@pylemon
pylemon / using_request_post_or_none.py
Created April 7, 2012 16:34
django: using(request.POST or None) hack in views | advanced forms usage
# simple form usage in view
def my_view(request, template_name='home.html'):
# sticks in a POST or renders an empty form
form = MyForm(request.POST or None)
if form.is_valid():
do_something()
return redirect('/')
return render_to_response(template_name, {'form':form})
# form with files
@badri
badri / cbv_multiple_forms.html
Created January 18, 2018 04:03
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">
@ObjSal
ObjSal / bitcoin.conf
Last active October 13, 2023 22:34
Instructions how to setup lightning network and tor in macOS
# For a full bitcoin.conf example see:
# https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf
# File stored in the external drive i.e. /Volumes/SSD/bitcoin.conf
# Change the data directory when running bitcoind or bitcoin-qt to the external drive
# $ bitcoind -datadir=/Volumes/SSD
# Authentication credentials created with rpcauth.py
# https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py
@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017 03:20
Responsive helpers (mobile-only etc.) for semantic-ui
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@pySilver
pySilver / admin.scss
Last active November 15, 2023 09:39
Integrates wagtail + wagtailmodeladmin + django-filter + django-autocomplete-light
/*
* ===================================================
* django-filter
* ===================================================
*/
.filter-form-header {
padding: 0;
h2 {
background-color: #fafafa;
@dcousens
dcousens / _scripttemplates.md
Last active February 3, 2024 18:59
Transaction / Script Templates
  • <> represents data or script
  • {} represents data that must prefixed by OP_PUSHDATA
  • [] represents multiple {}

Standard Scripts

PubKey (pay-to-pubkey / P2PK)

Address: N/A
scriptPubKey: {pubKey} OP_CHECKSIG
@maraujop
maraujop / forms.py
Created February 15, 2012 19:04
django-crispy-forms bootstrap form example
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class MessageForm(forms.Form):
text_input = forms.CharField()
@Zodiac1978
Zodiac1978 / .htaccess
Last active March 15, 2024 08:29
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/

A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.

Abstract

The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.