Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Zohaib Rauf zabirauf

I may be slow to respond.
View GitHub Profile
zabirauf / gopro-clip-mount.stl
Created Jan 8, 2023
GoPro mount that clips on one side and has the connector on other
View gopro-clip-mount.stl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
zabirauf / qc_for_cs_notebook.jl
Created Jan 10, 2021
Quantum computing for computer scientist - Julia notebook
View qc_for_cs_notebook.jl
### A Pluto.jl notebook ###
# v0.12.18
using Markdown
using InteractiveUtils
# ╔═╡ 72d474ec-4327-11eb-26d0-072a3be1e84f
using Pkg
zabirauf / qc_for_cs_notebook.html
Created Jan 10, 2021
Julia notebook for "Quantum computing for Computer scientist"
View qc_for_cs_notebook.html
<!DOCTYPE html>
<html lang="en">
<meta name="viewport" content="width=device-width" />
<title>⚡ Pluto.jl ⚡</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="" type="text/css" />
<link rel="stylesheet" href="" type="text/css" />
<link rel="stylesheet" href="" type="text/css" />
zabirauf / curry.ts
Created Jan 3, 2019
Strongly typed currying in Typescript
View curry.ts
type Func = (...args: any[]) => any;
type FirstParam<T extends Func> =
T extends (arg: infer J, ...args: infer U) => infer V
? J
: never;
type TailParams<T extends Func> =
T extends (arg: infer J, ...args: infer U) => infer V
? U
zabirauf /
Last active May 22, 2019
Renew certificate using certbot for MongoDB
# Define variables
# renew cert
certbot renew
# combine latest letsencrypt files for mongo
View GlobalCalculator_V2.sol
pragma solidity ^0.4.21;
import './GlobalCalculator.sol';
contract GlobalCalculator_V2 is GlobalCalculator_V1 {
function getMul() public view returns (uint mul) {
mul = 1;
for (uint i = 0;i < _nums.length; i++) {
mul *= _nums[i];
View GlobalCalculator_V1.sol
pragma solidity ^0.4.21;
contract GlobalCalculator_V1 {
uint[] internal _nums;
function addNum(uint x) public {
function getSum() public view returns (uint sum) {
zabirauf / UpgradeableContractProxy.sol
Last active Apr 16, 2018
Example of a ethereum smart contract that can be upgraded
View UpgradeableContractProxy.sol
pragma solidity ^0.4.21;
import "./Ownable.sol";
contract UpgradeableContractProxy is Ownable {
address private _currentImplementation;
function UpgradeableContractProxy() public Ownable() {
View TestStringToUintMap.sol
pragma solidity ^0.4.15;
import "truffle/Assert.sol";
import { StringToUintMap } from "../libraries/StringToUintMap.sol";
contract TestStringToUintMap {
StringToUintMap.Data private _stringToUintMapData;
function testInsertNewKey() {
// Arrange
View truffle.js
module.exports = {
networks: {
development: {
host: "localhost", // Ganache RPC server URL
port: 7545, // Ganache RPC server Port
network_id: "*" // Match any network id