Skip to content

Instantly share code, notes, and snippets.

Mardix mardix

Block or report user

Report or block mardix

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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)
*
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 / 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
@mardix
mardix / relift-example-stars-wars-simple.html
Last active Apr 21, 2019
relift-example-stars-wars-simple.html
View relift-example-stars-wars-simple.html
<div>
<div class="row">
<div class="column" id="starWarsWidget">
<div class="center">
<span r-if="(this.loadingStatus === 'pending')">
<div class="spinner">Loading...</div>
</span>
<h4 r-else>Welcome to Star Wars</h4>
</div>
<div>
You can’t perform that action at this time.