Skip to content

Instantly share code, notes, and snippets.

View amannirala13's full-sized avatar
πŸ˜ͺ
Procrastinating

Aman Nirala amannirala13

πŸ˜ͺ
Procrastinating
View GitHub Profile
@amannirala13
amannirala13 / dynamic_array.c
Created January 22, 2023 22:05
Dynamic array code in C
#include <stdio.h>
struct dArray{
void *buffer;
int length;
int type_size;
};
void init_array(struct dArray *arr, int type_size){
"""
Question: https://leetcode.com/problems/spiral-matrix-iii/
:author - amanniralq13
"""
# Processes a cell and appends it to the answers and dynamic refs
def processCell(row, col):
if 0 <= row < row_length and 0 <= col < col_length:
cell = matrix[row][col]
@amannirala13
amannirala13 / fb_vid.py
Created November 5, 2021 13:29
Facebook video downloader
import sys
import os
import re
import requests as r
import wget
# Change the output path here!
filedir = os.path.join('C:/Users/amann/Downloads/')
LINK = input("Enter a Facebook Video Post URL: ")
@amannirala13
amannirala13 / omegleip.js
Created November 2, 2021 23:07
Omegle WebRTC IP Tracer
/**
* author - amannirala13
* github - https://www.github.com/amannirala13
*
* Open your developers console and enter this script. It will obtain the IP address from the omegle client
* that uses WebRTC and get the geo loction. You can see the output on the console automatically as you connect to new people.
*/
window.oRTCPeerConnection = window.oRTCPeerConnection || window.RTCPeerConnection
window.RTCPeerConnection = function(...args) {
const pc = new window.oRTCPeerConnection(...args)
#include <iostream>
#include <string>
using namespace std;
class String{
private:
string str;
@amannirala13
amannirala13 / README.txt
Created June 9, 2021 09:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
@amannirala13
amannirala13 / Code.md
Created May 20, 2021 17:56 — forked from colinyip/Code.md
Example to wake up and show screen when android phone is locked

In AndroidManifest

<uses-permission android:name="android.permission.WAKE_LOCK" />

Create an new activity to show up in lock screen.

package com.example.colinyip.myapplication;

import android.support.v7.app.AppCompatActivity;
//implementation 'com.itextpdf:itextg:5.5.10'
package com.amannirala13.printtest
import android.os.Bundle
import android.os.Environment
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.itextpdf.text.Document
import com.itextpdf.text.PageSize
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.amannirala13.moviebooking.helpers.database;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;