Skip to content

Instantly share code, notes, and snippets.

Avatar

Armando Pérez Marqués mandx

View GitHub Profile
@mandx
mandx / install-pyls.sh
Created May 21, 2020
Install everything PyLS (Python Language Server) related
View install-pyls.sh
pip install 'python-language-server[flake8,mccabe,pycodestyle,pydocstyle,pyflakes,pylint,rope]' pyls-mypy pyls-black django-stubs djangorestframework-stubs
@mandx
mandx / clean_chrome.py
Created Jul 21, 2017
Simple Python 3 script to launch a new, clean Chrome instance
View clean_chrome.py
from subprocess import run
from tempfile import TemporaryDirectory
if __name__ == '__main__':
with TemporaryDirectory() as tempdir:
run([
'google-chrome',
'--user-data-dir==' + tempdir,
'--incognito',
View rebase_yarn_lockfile.sh
# From https://github.com/yarnpkg/yarn/issues/1776#issuecomment-269539948
# The approach that has worked for me so far is this:
git rebase origin/master
# When the first conflict arises, I checkout the yarn.lock then re-perform the installation
git checkout origin/master -- yarn.lock
yarn install
@mandx
mandx / cloud-image-region-transfer.sh
Created Jul 15, 2015
Script to copy a Rackspace server image from one data center (region) to another (by Andrew Howard)
View cloud-image-region-transfer.sh
#!/bin/bash
#
# Author: Andrew Howard
# This script will copy an server image from one region to another.
# BE AWARE: This will incur charges for the customer. These charges
# can be minimized by using ServiceNet for the download and by choosing
# to auto-delete the Cloud Files content once the transfer is complete.
# Even with these precautions, the customer will be charged for storage
# fees in Cloud Files (for a single month) and Cloud Images (destination).
# Note: To use ServiceNet, this script MUST be run on a Cloud Server
View upstart.sentry.conf
start on startup
setuid itslocal
exec /path/to/the/python-lib/or/virtualenv/bin/sentry --config=/path/to/my/sentry.conf.py start
@mandx
mandx / fields.py
Created Dec 7, 2012
Some Django fields enhancements
View fields.py
# -*- coding: utf-8 -*-
"""
Some custom field types
"""
import re
from django.conf import settings
from django.db import models
@mandx
mandx / dabblet.css
Created Apr 21, 2012
Vertical centering with Flexbox + margin fallback
View dabblet.css
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
You can’t perform that action at this time.