Skip to content

Instantly share code, notes, and snippets.

View nicolasmendoza's full-sized avatar
🎯
Focusing

Nicolás nicolasmendoza

🎯
Focusing
  • 19:33 (UTC -05:00)
View GitHub Profile
@GMMan
GMMan / ubuntu-gl502vs.md
Last active July 22, 2020 15:30
Problems and Solutions for Ubuntu 16.04 LTS on ASUS ROG GL502VS Laptop

Problems and Solutions for Ubuntu 16.04 LTS on ASUS ROG GL502VS Laptop

NVIDIA Graphics

Nouveau does not appear to support Pascal cards right now, so you should use the proprietary NVIDIA driver, available from the Additional Drivers applet.

Panel Dithering

@cansadadeserfeliz
cansadadeserfeliz / views.py
Last active March 24, 2020 00:55
Django (extreme case): How to raise form invalid inside form_valid method of a FormView (CreateView/UpdateView) and add an error message to not field errors
from django.forms.util import ErrorList
from django import forms
class ContractUpdateView(UpdateView):
model = Contract
template_name = 'contract/contract_form.html'
form_class = ContractForm
def form_valid(self, form):
if self.request.POST.get('finish'):
@icaoberg
icaoberg / remove.sh
Created March 6, 2013 21:32
[Git] Remove all *.pyc files from your git repository
#!/bin/bash
find . -name "*.pyc" -exec git rm {} \;
git commit -m "Removed compiled python files in distribution left after last commit"
@hoest
hoest / post.py
Created September 6, 2012 11:47
Simple Python script to post a XML file to an web-interface
import httplib
import xml.dom.minidom
HOST = "www.domain.nl"
API_URL = "/api/url"
def do_request(xml_location):
"""HTTP XML Post request"""
request = open(xml_location, "r").read()
@igniteflow
igniteflow / binary_upload.py
Created September 23, 2011 13:56
Python binary string compatible with Java byte array (as used in SOAP web services)
import base64
"""
Some useful functions for interacting with Java web services from Python.
"""
def make_file_java_byte_array_compatible(file_obj):
"""
Reads in a file and converts it to a format accepted as Java byte array
:param file object