Skip to content

Instantly share code, notes, and snippets.

Mardix mardix

View GitHub Profile
View CSVReader.php
<?php
/**
* CSVReader
* Class to parse and iterate CSV files on the fly
*
* <code>
* $myCsv = new CSVReader("$path/csv.csv");
*
* foreach ($myCsv as $data) {
* echo $data[2] ."\n";
@mardix
mardix / Voodoo\CanOfSpam.php
Last active May 8, 2020
Voodoo\CanOfSpam, a PHP 5.4 implementation to parse and get random spam text for blog comments
View Voodoo\CanOfSpam.php
<?php
/**
* CanOfSpam, a PHP 5.4 implementation to parse and get random spam text for blog comments
* -> https://gist.github.com/shanselman/5422230
*
* License: MIT
* Author : Mardix - http://github.com/mardix
*
* How to use
*
@mardix
mardix / python_over_ssh
Created Mar 21, 2017 — forked from mattyjones/python_over_ssh
Execute a script located on a remote server over ssh using python
View python_over_ssh
#! /usr/bin/env python
import secure
import pexpect
# the file containing the list of servers to log into
input_file = "script_list"
# The login creds
user = secure.USER
View summary_tool.py
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
@mardix
mardix / php-cs-fixer-pre-commit.php
Created Sep 4, 2012
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
View php-cs-fixer-pre-commit.php
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
@mardix
mardix / awesome-php.md
Created Nov 2, 2012 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries
View awesome-php.md
View gist:4dafb453e17d9a8efb064cf622aa7308
Remove culprit server
ssh-keygen -R remote-server-name-here
View gist:63b1b6ee8afd74695a58c96001a9b765
Install Dokku
# must have dokku as username
git remote add dokku dokku@example.com:flask-example
# Edit Procfile
...
# Push
View gist:00fa3606f56fa9e5ab87b1f4d30e4bc6
# To release pypi package
alias pypi-publish='python setup.py register -r pypi && python -m twine upload dist/*'
View gist:c96e1ce96ba0f544d7dd21b50867d91f
## Create virtualenv
> mkvirtualenv $name
> workon $name
## Develop
To install
> python setup.py develop
You can’t perform that action at this time.