Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Focusing

Faraz Fallahi fffaraz

🚀
Focusing
View GitHub Profile
View farsi.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<p><textarea rows="15" cols="100" id="src"></textarea></p>
<p><textarea rows="15" cols="100" id="dest" dir="rtl"></textarea></p>
View StringConstant.cpp
#include <iostream>
#include <string>
#include <vector>
#include <stdexcept>
#include <type_traits>
// The following is evil template "black magic". Only because we write it instead
// of the C++ standards committee. This first section is effectively a C++11
@fffaraz
fffaraz / index.php
Created Jul 10, 2014
php file listing
View index.php
<table border="1">
<th><td>File</td><td>Size</td></th>
<?php
$files = scandir(".");
$i = 0;
foreach($files as $entry)
{
View procstat.h
struct StatStuff
{
int pid; // %d
char comm[256]; // %s
char state; // %c
int ppid; // %d
int pgrp; // %d
int session; // %d
int tty_nr; // %d
int tpgid; // %d
@fffaraz
fffaraz / regex.html
Created Dec 21, 2014
Regex Cheat Sheet
View regex.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Regex Cheat Sheet</title>
<style type="text/css">
body { font-family: verdana; font-size: smaller; }
h2 { margin-bottom: 3px; font-size: small; }
th { background-color:#f6f6f6; }
td.sc { text-align:center; font-weight:bold; font-size:xx-large; font-family:"courier new", courier; }
View ui512test.cpp
#include <iostream>
#include <cstdint>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
#if 0
@fffaraz
fffaraz / ghosttest.c
Created Jan 29, 2015
GHOST vulnerability tester
View ghosttest.c
/* ghosttest.c: GHOST vulnerability tester */
/* Credit: http://www.openwall.com/lists/oss-security/2015/01/27/9 */
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
View gist:8d2d19f2783399571e63
#include <iostream>
using namespace std;
int main()
{
for(long long i=1000000000; i <= 9999999999; i++)
{
long long a = i;
int x[10] = {};
View copyright.sh
View 1.cpp
class C
{
public:
void *hello(void)
{
std::cout << "Hello, world!" << std::endl;
return 0;
}
static void *hello_helper(void *context)