Skip to content

Instantly share code, notes, and snippets.

View ofou's full-sized avatar
🚀
Launching

Omar Nomad ofou

🚀
Launching
View GitHub Profile
@jbedo
jbedo / hilbert.c
Created November 30, 2011 01:08
Matrix multiplication with Hilbert space-filling curves
#include<u.h>
#include<libc.h>
#define MAX(a, b) ((a) > (b) ? (a) : (b))
/* Hilbert curve functions (from Wikipedia) */
/* rotate/flip a quadrant appropriately */
void rot(int n, int *x, int *y, int rx, int ry)
{
@reddragon
reddragon / Palindrome.java
Created January 29, 2012 01:24
Finding the number of palindromes in a text corpus using Hadoop
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
@josephmisiti
josephmisiti / helloevolve.py
Created November 11, 2016 18:19
helloevolve.py - a simple genetic algorithm in Python
"""
helloevolve.py implements a genetic algorithm that starts with a base
population of randomly generated strings, iterates over a certain number of
generations while implementing 'natural selection', and prints out the most fit
string.
The parameters of the simulation can be changed by modifying one of the many
global variables. To change the "most fit" string, modify OPTIMAL. POP_SIZE
controls the size of each generation, and GENERATIONS is the amount of
generations that the simulation will loop through before returning the fittest
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@brahimmachkouri
brahimmachkouri / uninstall_ajenti.sh
Last active August 2, 2022 19:34
Uninstall Ajenti
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
DISTRO=
OS=
if grep 'Debian' /etc/issue > /dev/null 2>&1 ; then
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active July 15, 2024 19:38
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@Potherca
Potherca / solutions-stacks.csv
Last active May 20, 2024 19:57
Solution Stack Acronyms
Stack Name Stack Type Operating System / Platform Server Database Language or SDK Framework UI Message Bus / Queue
AMP Web (Backend) Apache MySQL / MariaDB Perl / PHP / Python
BAMP Web (Backend) BSD Apache MySQL / MariaDB Perl / PHP / Python
BAPP Web (Backend) BSD Apache PostgreSQL Perl / PHP / Python
BCHS Web (Backend) BSD SQLite httpd C
DAMP Web (Backend) Darwin Apache MySQL / MariaDB Perl / PHP / Python
ELK Time Series Data Logstash Elasticsearch Kibana
ELKB Time Series Data Logstash Elasticsearch Beats Kibana
FAMP Web (Backend) FreeBSD Apache MySQL / MariaDB Perl / PHP / Python
FWAP Web (Backend) Windows Apache Firebird Perl / PHP / Python
@p4bl0-
p4bl0- / 00_readme.md
Last active October 12, 2023 09:09
A complete compiler for a simple language (in less than 150 LoC)

This project is a tiny compiler for a very simple language consisting of boolean expression.

The language has two constants: 1 for true and 0 for false, and 4 logic gates: ! (not), & (and), | (or), and ^ (xor).

It can also use parentheses to manage priorities.

Here is its grammar in BNF format:

expr ::= "0" | "1"

@rain-1
rain-1 / GPT-4 Reverse Turing Test.md
Last active May 28, 2024 17:40
GPT-4 Reverse Turing Test

The reverse turing test

I asked GPT-4 to come up with 10 questions to determine if the answerer was AI or human.

I provided my own answers for these questions and I also asked ChatGPT to answer them.

The result is that GPT-4 was able to correctly differentiate between AI and Human.