Skip to content

Instantly share code, notes, and snippets.

View m-primo's full-sized avatar

Primo m-primo

View GitHub Profile
@m-primo
m-primo / docker-centos7.sh
Last active December 10, 2023 22:19
Quick Docker installation for Linux distros in one gist. (I have added this for my personal use, feel free to use & edit it however you like)
#!/bin/bash
# Make sure to run the file as super user (sudo) first.
# https://docs.docker.com/engine/install/centos/
# Install the yum-utils package to have yum-config-manager
yum install -y yum-utils
# Add Docker to the packages repository
@m-primo
m-primo / std-media-query.css
Created April 26, 2020 23:25
Standard CSS Media Query
/* Max */
@media (max-width: 319px) { /* X-Small Screen */
}
@media (max-width: 479px) { /* Small Screen */
}
@media (max-width: 767px) { /* Medium Screen */
@m-primo
m-primo / Random.class.php
Created April 25, 2020 20:42
Random Number by Seed with PHP
<?php
class Random {
// random seed
private static $RSeed = 0;
// set seed
public static function seed($s = 0) {
self::$RSeed = abs(intval($s)) % 9999999 + 1;
self::num();
}
@m-primo
m-primo / admin_finder.py
Created April 25, 2020 19:07
Admin Link Finder [manually] - python
import requests
# Initializations
panels = ["admin.php", "wp-login.php", "login.php", "admin/admin.php", "admin/index.php"]
found = 0
notFound = 0
# Inputs
url = input("[*] Enter URL: ")
@m-primo
m-primo / cvv_generator.py
Created April 25, 2020 19:03
Credit Card CVV random generator - python
# Imports
###############################################################
import random
###############################################################
# Functions
###############################################################
def generateCVV(type):
if type == 1:
i = random.randint(0, 9)
@m-primo
m-primo / factorial.c
Last active April 25, 2020 14:49
factorial in c
int factorial(int i) {
if(i <= 1) return 1;
return i * factorial(i - 1);
}
@m-primo
m-primo / fibnaccio.c
Created April 25, 2020 14:47
fibnaccio series in c
int fibonacci(int i) {
if(i == 0 || i == 1) return i;
return fibonacci(i-1) + fibonacci(i-2);
}
@m-primo
m-primo / days_in_month.cpp
Last active April 25, 2020 14:45
days in month - c++
cin >> month_num;
switch (month_num)
{
case 1:case 3:case 5:case 7:case 8:case 10:case 12:
daysinmonth = 31;
break;
case 2:
daysinmonth = 28;
break;
case 4: case 6: case 9: case 11:
@m-primo
m-primo / largest_so_far.cpp
Created April 25, 2020 14:43
find the largest value in c++
#include "stdafx.h"
#include <iostream>
using namespace std;
int main() {
int itemValue;
int largestSoFar;
int minValue;
@m-primo
m-primo / pascal_tri.cpp
Created April 25, 2020 14:43
pascal triangle c++
#include <iostream>
using namespace std;
int a, b;
int main() {
cout << "A: ";
cin >> a;
cout << 1 << " " << endl;
for(int i = 0; i <= a; i++) {