Skip to content

Instantly share code, notes, and snippets.

puts("أهلًا يا عالم!");
@a3f
a3f / Makefile
Created February 8, 2015 16:01
Simple Makefile template
# hereby released into the public domain (first time; Am I doing this right?)
#.
#├── Makefile
#│
#├── $(SRCDIR)
#│ └── $(SRCS) (source files)
#│
#├── $(OBJDIR)
#│ ├── *.o (automatically generated)
<?php
if(!defined('INITIALIZED'))
exit;
if(!$logged)
if($action == "logout")
$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Logout Successful</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderB
<?php
if(!defined('INITIALIZED'))
exit;
if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'logout')
Visitor::logout();
if(isset($_REQUEST['account_login']) && isset($_REQUEST['password_login']))
{
Visitor::setAccount($_REQUEST['account_login']);
Visitor::setPassword($_REQUEST['password_login']);
@a3f
a3f / maze.c
Last active August 29, 2015 14:20
Find all paths from that lead outside the maze starting from a given position
#include <stdio.h>
#include <stdlib.h>
#define I_MAX 11
#define J_MAX 8
enum {FREE = 0, BLOCKED = 1, END = 2, DONE, SOLUTION};
int maze[I_MAX][J_MAX] = {
{1, 0, 1, 1, 1, 1, 1, 1},
{1, 0, 0, 0, 0, 1, 1, 1},
{1, 1, 0, 0, 1, 0, 1, 1},
{1, 0, 1, 0, 1, 1, 1, 1},
// engine.h
typedef struct{
unsigned height;
unsigned width;
char *buffer;
}screen_t[1];
screen_t screen_new(unsigned x, unsigned y);
void screen_delete(screen_t screen);
#!/usr/bin/perl
use Inline C => Config => LIBS => '-lm';
use Inline C;
use strict;
use warnings;
my $a = 81;
my $c = root($a);
print $c,"\n";
#include <windows.h>
#include <conio.h>
#include <stdlib.h>
char *title = "Mandelbrot Set";
#define SIZE 600
#define ITERS 25
int main()
{
int x, y, i;
double zx, zy, cx, cy, tmp;
#include <windows.h>
#include <conio.h>
#include <stdlib.h>
#include <complex.h>
#include <math.h>
const char *title = "Mandelbrot Set";
#define SIZE 600
#define ITERS 25
int main(void)
#include <windows.h>
HWND hwnd;
LRESULT CALLBACK WndProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam);
int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t * lpCmdLine, int nCmdShow)
{
MSG Msg;
WNDCLASSEX WndClsEx = {0};