Skip to content

Instantly share code, notes, and snippets.

View fffaraz's full-sized avatar
🚀
Focusing

Faraz Fallahi fffaraz

🚀
Focusing
View GitHub Profile
// HTTP forward proxy server that can also proxy HTTPS requests
// using the CONNECT method
// requires https://github.com/nodejitsu/node-http-proxy
var httpProxy = require('http-proxy');
var url = require('url');
var net = require('net');
var http = require('http');
@fffaraz
fffaraz / farsi.html
Created June 29, 2014 11:23
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>
#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 July 10, 2014 09:23
php file listing
<table border="1">
<th><td>File</td><td>Size</td></th>
<?php
$files = scandir(".");
$i = 0;
foreach($files as $entry)
{
@fffaraz
fffaraz / projects.md
Last active May 9, 2024 18:11
Project Ideas List

http://www.dreamincode.net/forums/topic/78802-martyr2s-mega-project-ideas-list/

Text

Reverse a String Enter a string and the program will reverse it and print it out.

Pig Latin Pig Latin is a game of alterations played on the English language game. To create the Pig Latin form of an English word the initial consonant sound is transposed to the end of the word and an ay is affixed (Ex.: "banana" would yield anana-bay). Read Wikipedia for more information on rules.

@fffaraz
fffaraz / rand.cpp
Created July 22, 2014 10:51
Random number in Qt
#include <QGlobal.h>
#include <QTime>
int QMyClass::randInt(int low, int high)
{
// Random number between low and high
return qrand() % ((high + 1) - low) + low;
}
// Create seed for the random
@fffaraz
fffaraz / tcp_syn.py
Created July 30, 2014 22:07
TCP syn flood in python using raw sockets
'''
Syn flood program in python using raw sockets (Linux)
http://www.binarytides.com/python-syn-flood-program-raw-sockets-linux/
Silver Moon ([email protected])
'''
# some imports
import socket, sys
from struct import *
@fffaraz
fffaraz / resources.md
Last active August 15, 2024 17:57
CS 306 - Linux/UNIX Programming
@fffaraz
fffaraz / procstat.h
Created November 15, 2014 05:59
/proc/%d/stat
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