/etc/systemd/logind.conf
:
HandleLidSwitch=ignore
sudo systemctl stop systemd-logind && sudo systemctl start systemd-logind
from scrapy.xlib.pydispatch import dispatcher | |
from scrapy import signals | |
from scrapy.exceptions import DropItem | |
from scrapy.utils.serialize import ScrapyJSONEncoder | |
from carrot.connection import BrokerConnection | |
from carrot.messaging import Publisher | |
from twisted.internet.threads import deferToThread |
import argparse | |
import cloudfiles | |
from cloudfiles.connection import Connection | |
AUTH_URLS = ['uk_authurl', 'us_authurl'] | |
if __name__ == '__main__': |
import sys | |
from collections import defaultdict | |
import requests | |
file_name = sys.argv[1] | |
results = defaultdict(list) | |
with open(file_name) as f: |
import optparse | |
from mandrill import Mandrill | |
from mandrill import UnknownTemplateError | |
def sync_templates(source_key, destination_key, update_existing=True, dry_run=False): | |
def perform_action(action): | |
'''Simple wrapper to skip actaully doing anything if dry run is enabled. |
from django.conf.urls import patterns, url | |
from django.contrib.contenttypes.models import ContentType | |
from appname1.views import PostListView, PostDetailView, \ | |
PostCreateView, PostDeleteView, PostUpdateView | |
from appname2.views import CommentListView,\ | |
CommentDetailView, CommentCreateView, CommentDeleteView, \ | |
CommentUpdateView | |
from models import Post |
<div id="fb-root"></div> | |
<script> | |
var fbAppId = '< APP ID >'; | |
(function(){ | |
var fbInitFuncs = []; | |
var fbInitialized = false; | |
window.fbAsyncInit = function() { |
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
This stuff will be native in Rails 3.1 and the layout of the files on the | |
filesystem will be different but this guide will get you working with it | |
while we wait for all that to finalize. | |
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist. | |
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention |
class CarmenCountryInput < SimpleForm::Inputs::PriorityInput | |
def input | |
@builder.send(:"country_select", attribute_name, input_options, input_html_options) | |
end | |
end |
- flash.each do |type, message| | |
.alert.alert-block{:class => "alert-#{bootstrap_alert_type(type)}" } | |
%h4.alert-heading #{ bootstrap_alert_type(type).titleize }! | |
= message |