Skip to content

Instantly share code, notes, and snippets.

@masudianpour
masudianpour / web-servers.md
Created September 26, 2017 08:49 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@masudianpour
masudianpour / pso.php
Created December 16, 2014 23:46
PSO (Particle Swarm Optimization) Algorithm implementation in PHP
<?php
/**
* PSO Algorithm implementation
*
* #############################################################################
* #FUNCTION: <Booth's function>
* #EQUATION: <f(x,y)=(x+2y-7)^2 + (2x+y-5)^2>
* #MINIMUM: <f(1,3)=0>
* #SEARCH DOMAIN: < -10<=x,y<=10 >
@masudianpour
masudianpour / de.php
Created December 16, 2014 23:44
DE (Differential Evolution) Algorithm implementation in PHP
<?php
/**
* DE[Differential Evolution] Algorithm implementation
*
* #############################################################################
* #FUNCTION: <Booth's function>
* #EQUATION: <f(x,y)=(x+2y-7)^2 + (2x+y-5)^2>
* #MINIMUM: <f(1,3)=0>
* #SEARCH DOMAIN: < -10<=x,y<=10 >
* @link http://en.wikipedia.org/wiki/Test_functions_for_optimization the function link
#!/usr/bin/python
import re
from collections import defaultdict
import time
'''
Report Class
To open a log file, process it and print result
'''
class Report(object):
@masudianpour
masudianpour / .gitignore
Last active December 18, 2017 07:39
Yii Git Ignore
assets/*
!assets/.gitignore
protected/runtime/*
!protected/runtime/.gitignore
protected/data/*.db
themes/classic/views/
nbproject/
nbproject/*
nbproject/private/
@masudianpour
masudianpour / Laravel & NginX
Created February 14, 2014 11:29
Configurations for NginX in order to run Laravel 4
server{
listen 90;
server_name masud.dev;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
rewrite_log on;