Skip to content

Instantly share code, notes, and snippets.

View mvanga's full-sized avatar

Manohar Vanga mvanga

View GitHub Profile
@hjr3
hjr3 / e-commerce.md
Created April 3, 2012 05:35
Examples of RESTful API calls for E-commerce platforms

Examples of RESTful API calls for E-commerce platforms

These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.

Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.

Relevant links

#!/usr/bin/env python
# This is an example Git server. http://blog.nerds.kr/post/106956608369/implementing-a-git-http-server-in-python
# Stewart Park <stewartpark92@gmail.com>
from flask import Flask, make_response, request, abort
from StringIO import StringIO
from dulwich.pack import PackStreamReader
import subprocess, os.path
from flask.ext.httpauth import HTTPBasicAuth
@pirapira
pirapira / auction00.sol
Last active November 4, 2021 13:32
An auction contract written in Solidity
contract auction {
// An auction contract written in Solidity
// Can be deployed similarly to what is described at:
// https://dappsforbeginners.wordpress.com/tutorials/your-first-dapp/
// Initialization.
// Remembering bids from each address.
mapping (address => uint) bids;
// Also remembering the max_bid and the max_bidder to easily determine the winner.
uint max_bid = 0;
@FrankBuss
FrankBuss / emulator.cpp
Last active April 9, 2024 05:46
RISC-V emulator (RV32I only) in one C++ file
/*
See https://gitlab.com/nedopc/npc5/blob/master/emu-rv32i.c for the latest version, with more features and less bugs :-)
RISCV emulator for the RV32I architecture
based on TinyEMU by Fabrice Bellard, see https://bellard.org/tinyemu/
stripped down for RV32I only, all "gotos" removed, and fixed some bugs for the compliance test
by Frank Buss, 2018
Requires libelf-dev:
@stackdump
stackdump / finite.py
Last active September 15, 2022 15:25
Finite is a - Rank 1 Constraint System: (R1CS) That uses Petri-Nets as a means to construct Zero Knowledge Proofs.
"""
MIT License https://github.com/FactomProject/ptnet-eventstore/blob/master/LICENSE
Finite is a - Rank 1 Constraint System: (R1CS)
That uses Petri-Nets as a means to construct Zero Knowledge Proofs.
The author is planning to deploy using The Factom Blockchain https://www.factom.com/factom-blockchain/
with the notion that this protocol is useful as an addressing system to index other forms of proofs.
Because Factom can isolate users from the need to own cryptocurrency, it is hoped that adoption can reach outside of
@cb372
cb372 / riscv.md
Last active April 2, 2024 06:41
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@HarryR
HarryR / KZG10.py
Last active October 4, 2022 11:50
Implementation of PolyCommit_{DL} from "Constant-Size Commitments to Polynomials and Their Applications" https://www.cypherpunks.ca/~iang/pubs/PolyCommit-AsiaCrypt.pdf
from typing import List, NamedTuple, Tuple, Union
from math import ceil, log2
from random import randint
from functools import reduce
import operator
from py_ecc import bn128 as curve
"""
Implementation of PolyCommit_{DL} from:
@dabeaz
dabeaz / README.txt
Created October 15, 2019 20:10
PyCon India 2019, Code from Keynote Presentation by @dabeaz
Code from PyCon India 2019 Keynote Talk
David Beazley (https://www.dabeaz.com)
======================================
This code is presented "as is" and represents what was live-coded
during my closing keynote presentation at PyCon India, Chennai,
October 13, 2009. I have made no changes to the files.
Requires: Python 3.6+, numpy, pygame
@ih2502mk
ih2502mk / list.md
Last active April 26, 2024 07:00
Quantopian Lectures Saved
@pushpendre
pushpendre / pid_control_servers.ipynb
Created July 4, 2021 19:49
PID Controller for controlling the number of servers in a data-center. This notebook accompanies the video https://youtu.be/pKuVUmpYkLk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.