Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Focusing

Faraz Fallahi fffaraz

🚀
Focusing
View GitHub Profile
View https_forward_proxy.js
// 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');
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)
{
@fffaraz
fffaraz / projects.md
Last active Apr 17, 2021
Project Ideas List
View projects.md

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 Jul 22, 2014
Random number in Qt
View rand.cpp
#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 Jul 30, 2014
TCP syn flood in python using raw sockets
View tcp_syn.py
'''
Syn flood program in python using raw sockets (Linux)
http://www.binarytides.com/python-syn-flood-program-raw-sockets-linux/
Silver Moon (m00n.silv3r@gmail.com)
'''
# some imports
import socket, sys
from struct import *
@fffaraz
fffaraz / resources.md
Last active Nov 6, 2021
CS 306 - Linux/UNIX Programming
View resources.md
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