Skip to content

Instantly share code, notes, and snippets.

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

ruh zyryc

🏠
Working from home
View GitHub Profile
@zyryc
zyryc / downloadwallpapers.py
Created August 20, 2023 13:31
Fetch wallpapers from the internet and download it
import requests
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup
import time
import os
Visited_pages = set()
@zyryc
zyryc / weatherSvgs.js
Created October 11, 2021 16:38
tomorrow-weather-codes
weatherSvgs = {
"1000":"color/clear_day.svg",
"1000":"color/clear_night.svg",
"1001":"color/cloudy.svg",
"4000":"color/drizzle.svg",
"5001":"color/flurries.svg",
"2100":"color/fog_light.svg",
"2000":"color/fog.svg",
"6000":"color/freezing_drizzle.svg",
"6201":"color/freezing_rain_heavy.svg",
@zyryc
zyryc / Mains.java
Created May 7, 2021 11:23
Print statement like python in java :-)
import java.util.Scanner;
public class Mains {
public static void main(String[] args) {
print("What is your name ? :");
String input = input();
print("your name is : " + input);
@zyryc
zyryc / Media.php
Created January 13, 2021 12:05
codeigniter 3 file upload method
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Event extends MY_Controller{
function __construct()
{
parent::__construct();
}
//$file is the file name from form input
//example is <input type="file" name="my_image" >
def fib(n):
if n<=0:
print("invalid input")
elif n==1:
return 0
elif n==2:
return 1
else:
return fib(n-1)+fib(n-2)
@zyryc
zyryc / faker.py
Created December 25, 2020 08:25
generate fake data for your database
import sqlite3
from faker import Faker
from random import randrange
fake = Faker()
conn = sqlite3.connect('users.sqlite3')
cursor = conn.cursor()
@zyryc
zyryc / friendrequest.js
Last active December 26, 2020 07:29
send many friend requests at a go
var btn = document.getElementsByTagName('button');
for(let i=0; i<btn.length; i++){
btn[i].click();
console.log(i);
}
//open https://m.facebook.com/friends/center/requests/
// open consoe
// copy your console
// run
// happy hacking !!
@zyryc
zyryc / Fibonacci.java
Created November 18, 2020 11:53
Fibocacci sequence recursively and by iteration
/**
*
* @author ruiyot
*/
public class Fibonacci {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
@zyryc
zyryc / organize.sh
Created October 30, 2020 07:34
organize your downloads linux shell
#! /bin/sh
for file in *.mp4 *.mov *.mkv *.flv *.avi *.webm *.wmv; do
mv -- "$file" /home/$USER/Videos
done
for file in *.jpg *.png *.webp *.svg *.jp*g *.JPG *.gif; do
mv -- "$file" /home/$USER/Pictures
done
for file in *.mp3 *.mpeg *.m4a *.aac *.wma; do
//for 10 * 10 matrix
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
class matrixc