Skip to content

Instantly share code, notes, and snippets.

View HamzaAnis's full-sized avatar
:electron:
Excellence is not a skill, it's an attitude.

Hamza Anis HamzaAnis

:electron:
Excellence is not a skill, it's an attitude.
View GitHub Profile
@HamzaAnis
HamzaAnis / HackerRank.go
Last active November 8, 2017 11:16
HackerRank competition
/*Shaheryar is a civil engineer and he is working on a site. His work is to excavate (digg) a tunnel he has been provided with three different capacity of tractor trollies suppose x,y,z every time he will be provided with n kg's of mud to fill the three trollies his work is to fill the trolleys according to their capacity. he want to maximize the performance by filling all the trolleys according to thier capacity and once all the trolleys are fully fill only then he will shift the mud from one place to another.
Input Format
Three trolleys with different capacities are 12,45,78. Shaheryaar must fill the trolleys simultaneously. 2 first time 2 kg's of mud is provided which should be put in first trolley with 12kg's of capacity, now as two kg is filled only 10 kg is left. 11 second time 11 kg's of mud is provided he will put 10 kg in first trolley and 1 kg in second as first trolley is full after putting 10 kg. 122 third time 122 kg's of mud is provided 44 kg should be put in second trolley and the rest of the
@HamzaAnis
HamzaAnis / BlockStack
Last active November 10, 2017 05:24
BlockStack verification
Verifying my Blockstack ID is secured with the address 12byzo5TZUKeicXPQbNSonCoACW1UbMpQV https://explorer.blockstack.org/address/12byzo5TZUKeicXPQbNSonCoACW1UbMpQV
{
// Set to the number of CPU cores of your server
"threads": 2,
// Prefix for keys in redis store
"coin": "eth",
// Give unique name to each instance
"name": "main",
"proxy": {
"enabled": true,
@HamzaAnis
HamzaAnis / main.go
Last active February 6, 2018 15:06
Download the images from the link programatically
package main
import (
"bufio"
"encoding/csv"
"fmt"
"io"
"net/http"
"os"
"strings"
@HamzaAnis
HamzaAnis / zohodelay.js
Created August 11, 2018 15:01
A trick to add a delay of 5 seconds in the zoho forms
void delay()
{
info now;
thislist = List();
thislist={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
for each l in thislist
{
response = getUrl( "https://wait.glitch.me/5");
}
info now;
@HamzaAnis
HamzaAnis / index.html
Created October 19, 2018 09:35
Countdown timer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Timer</title>
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
type Queue []*Node
func (q *Queue) Push(n *Node) {
*q = append(*q, n)
}
func (q *Queue) Pop() (n *Node) {
n = (*q)[0]
*q = (*q)[1:]
return
@HamzaAnis
HamzaAnis / Install Vscode
Created April 12, 2019 13:47
Installing vscode using snap
sudo snap install code --classic
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
"os"
"os/signal"
class Node:
def __init__(self, val=None, p=None, l=None, r=None):
self.key = val
self.parent = p
self.left_child = l
self.right_child = r
self.balance_factor = 0
def __repr__(self):
s = str(self.key)