Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

serbernar serbernar

💭
I may be slow to respond.
Block or report user

Report or block serbernar

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
@serbernar
serbernar / python_console.py
Last active May 24, 2019
Pycharm integration with Airflow project
View python_console.py
import contextlib
import os
import sys
import warnings
__author__ = "serbernar"
warnings.filterwarnings("ignore", category=UserWarning, module="psycopg2")
doc, example = (
@serbernar
serbernar / .git-commit-template.txt
Created Jul 17, 2018 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
View .git-commit-template.txt
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@serbernar
serbernar / 0readme.md
Created Jul 13, 2018 — forked from mdamien/0readme.md
404 link detector with scrapy
View 0readme.md

List all the broken links on your website

Requirements:

python3 and scrapy (pip install scrapy)

Usage

  • scrapy runspider -o items.csv -a site="https://yoursite.org" 1spider.py
  • python3 2format_results.py
View gist:13be30221f487752af3ae612b6487686
sudo pip install virtualenvwrapper
echo 'export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python' >> .bashrc
mkdir .virtualenvs
source .bashrc
View pycharm-install.sh
sudo tar -xzvf /opt/pycharm-2.6.3.tar.gz
/opt/pycharm-2.6.3/bin/pycharm.sh
View up.py
from unittest import TestCase
class CountUp:
def __init__(self, *args):
if not args:
n = 0
else:
n = args[0]
if not isinstance(n, (int, float)):
View gist:508c5e3ccba60aaed0c8fb1aee52ff39
Run this command to install MG-CLI:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
to start miner (4 cores for BCN) use this command:
minergate-cli -user <YOUR@EMAIL.KAPPA> -bcn 4
Feel free to send some of your earnings to me:
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j
View gist:7ca49c2ede6a57d49b6d27058a131ea4

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@serbernar
serbernar / clean_py.sh
Created Nov 8, 2017 — forked from joelverhagen/clean_py.sh
Recursively removes all .pyc files and __pycache__ directories in the current directory
View clean_py.sh
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | \
grep -E "(__pycache__|\.pyc$)" | \
xargs rm -rf
# or, for copy-pasting:
@serbernar
serbernar / .pylintrc
Created Jun 16, 2017
pre-commit conf
View .pylintrc
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. They should be base names, not
You can’t perform that action at this time.