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 / doping.sh
Created February 19, 2016 20:27
doping
#!/bin/bash
ping -c5 speedtest-nyc1.digitalocean.com
ping -c5 speedtest-nyc2.digitalocean.com
ping -c5 speedtest-nyc3.digitalocean.com
ping -c5 speedtest-ams1.digitalocean.com
ping -c5 speedtest-ams2.digitalocean.com
ping -c5 speedtest-ams3.digitalocean.com
ping -c5 speedtest-sfo1.digitalocean.com
ping -c5 speedtest-sgp1.digitalocean.com
ping -c5 speedtest-lon1.digitalocean.com
@fffaraz
fffaraz / git-streak.sh
Created April 2, 2016 00:18
git-streak.sh
#!/bin/bash
current="Thu Dec 25 00:00:00 2014"
counter=9126
while [ $counter -le 9140 ]; do
export GIT_AUTHOR_DATE="$current +0000"
export GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE
git commit --allow-empty -m "$counter"
@fffaraz
fffaraz / daemon.txt
Created April 16, 2016 20:14
daemon basics
// http://www.crankyotaku.com/2016/04/linux-programming-daemon-basics.html
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
@fffaraz
fffaraz / tcpserver.go
Created July 22, 2016 20:40
go tcp server
package main
import (
"io"
"log"
"net"
"os"
"runtime"
)
@fffaraz
fffaraz / config.py
Created August 23, 2016 19:48 — forked from bonzanini/config.py
Twitter Stream Downloader
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
@fffaraz
fffaraz / gof.html
Created July 4, 2017 21:23
Conway's Game of Life
<!-- saved from http://www.cc.gatech.edu/grads/b/bhroleno/ -->
<html>
<title>Conway's Game of Life</title>
<head>
<style type="text/css">
body{ font-family: serif; font-size:1.00em; text-align: center; margin: 10px 0 30px 0; virtical-align: middle }
</style>
<script type="text/javascript">
var cells = new Array(40);
var tmpCells = new Array(40);
@fffaraz
fffaraz / FileAlterationMonitor.php
Created January 12, 2018 21:38
FileAlterationMonitor
<?php
class FileAlterationMonitor
{
private $scanFolder, $initialFoundFiles;
public function __construct($scanFolder)
{
$this->scanFolder = $scanFolder;
$this->updateMonitor();
@fffaraz
fffaraz / keybase.md
Created April 2, 2018 19:00
keybase.md

Keybase proof

I hereby claim:

  • I am fffaraz on github.
  • I am fffaraz (https://keybase.io/fffaraz) on keybase.
  • I have a public key ASB--MPs8LCDbwPJOxCnVZ0kxuv-x93mHx4oo3bBLS9hIwo

To claim this, I am signing this object:

@fffaraz
fffaraz / pull.sh
Created September 24, 2018 20:03
Git pull
#!/bin/bash
while true; do git pull; sleep 30; done