Skip to content

Instantly share code, notes, and snippets.

View RidhwaanDev's full-sized avatar
🏠
Working from home

Ridhwaan Ahmed RidhwaanDev

🏠
Working from home
View GitHub Profile
@RidhwaanDev
RidhwaanDev / search.go
Last active April 8, 2021 20:59
Search code for the leaked Facebook data on Aril 3rd, 2021. About 3GB worth of text files. Educational purposes only
package main
import (
"bufio"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
@RidhwaanDev
RidhwaanDev / prime.go
Created October 13, 2020 21:19
Sieve of Eratosthenes
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Welcome to Sieve of Eratosthenes prime number calcualtor")
fmt.Println("How many prime numbers do you want?")
@RidhwaanDev
RidhwaanDev / groupie.js
Last active February 17, 2020 21:44
Groupie - like very message in a group me chat because you are a cool.
const token = ""; // groupme api token
const axios = require('axios');
const group_id = ""; // groupid
async function get_messages(){
const message_url = `https://api.groupme.com/v3/groups/${group_id}/messages?token=${token}&limit=100`;
const m = await axios.get(message_url);
const messages = m.data.response.messages;
for(let i = 0; i < messages.length; i++){
import java.util.Random;
public class RandomWalk {
public double walk(int n ){
int x = 0;
int y = 0;
while(n > 0){
// generate random num from 0..3
int direction = new Random().nextInt(4);
@RidhwaanDev
RidhwaanDev / Animate.kt
Created April 8, 2019 17:27
Smooth Google Maps Marker movement
inner class map_animate(val marker: Marker?, val oldpos : LatLng?, val newpos: LatLng, val handler: Handler) : Runnable {
val start : Long = SystemClock.uptimeMillis()
val interpolator = AccelerateDecelerateInterpolator()
val duration : Float = 3000f
var elapsed: Long = 0
var t : Float = 0f
var v : Float = 0f
var hidemarker : Boolean = false