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
import java.io.*;
import java.util.*;
// WordSearch class interface: solve word search puzzle
//
// CONSTRUCTION: with no initializer
// ******************PUBLIC OPERATIONS******************
// int solvePuzzle( ) --> Print all words found in the
// puzzle; return number of matches
//for 10 * 10 matrix
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
class matrixc
@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
@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 / 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()
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 / 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 / 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" >
@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 / 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",