This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.transaction import * # NOQA | |
from django.utils.decorators import ContextDecorator | |
LOCK_MODES = ( | |
'ACCESS SHARE', | |
'ROW SHARE', | |
'ROW EXCLUSIVE', | |
'SHARE UPDATE EXCLUSIVE', | |
'SHARE', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This script should prevent the following suspend errors | |
# which freezes the Dell Inspiron laptop. | |
# | |
# Put it in /usr/lib/systemd/system-sleep/xhci.sh | |
# | |
# The PCI 00:14.0 device is the usb xhci controller. | |
# | |
# kernel: [67445.560610] pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: jupyterhub | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start jupyterhub | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://gorails.com/setup/ubuntu/14.04 | |
sudo apt-get update | |
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties | |
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev | |
curl -L https://get.rvm.io | bash -s stable | |
source ~/.rvm/scripts/rvm | |
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc | |
rvm install 2.1.2 | |
rvm use 2.1.2 --default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Source: https://gist.github.com/carolineschnapp/9122054 | |
If you are not on a collection page, do define which collection to use in the order form. | |
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle. | |
{% assign collection = collections.your-collection-handle-here %} | |
Use the assign statement outside of this comment block at the top of your template. | |
{% endcomment %} | |
{% paginate collection.products by 100 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.conf import settings | |
from django.core.files.storage import FileSystemStorage | |
from django.db import models | |
class OverwriteStorage(FileSystemStorage): | |
''' | |
Muda o comportamento padrão do Django e o faz sobrescrever arquivos de | |
mesmo nome que foram carregados pelo usuário ao invés de renomeá-los. | |
''' |