MD5: 59bab8f71f8c096cd3f72cd73851515d
Rename it to: Sublime Text
Make it executable with: chmod u+x Sublime\ Text
| class Users::SessionsController < Devise::SessionsController | |
| # Have to reimplement :recall => "failure" | |
| # for warden to redirect to some action that will return what I want | |
| def create | |
| resource = warden.authenticate!(:scope => resource_name, :recall => "failure") | |
| # set_flash_message :notice, :signed_in | |
| sign_in_and_redirect(resource_name, resource) | |
| end | |
| # <rails_root>/lib/simple_form/label_nested_input.rb | |
| module SimpleForm | |
| module Components | |
| module LabelInput | |
| extend ActiveSupport::Concern | |
| included do | |
| include SimpleForm::Components::Labels | |
| end |
| zh-CN: | |
| errors: | |
| messages: | |
| expired: "您已过期,请重新申请" | |
| not_found: "没有找到" | |
| already_confirmed: "已经确认" | |
| not_locked: "未锁定" | |
| not_saved: | |
| one: "因为1个错误导致此%{resource}保存失败:" | |
| other: "因为%{count}个错误导致此%{resource}保存失败:" |
| <%= form_for(@user) do |f| %> | |
| <% if @user.errors.any? %> | |
| <div id="error_explanation"> | |
| <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2> | |
| <ul> | |
| <% @user.errors.full_messages.each do |msg| %> | |
| <li><%= msg %></li> | |
| <% end %> | |
| </ul> |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| from collections import OrderedDict | |
| # ... | |
| class OrderFormMixin(object): | |
| ''' | |
| To apply add to Meta 'order' iterable | |
| ''' | |
| def __init__(self, *args, **kwargs): | |
| super(OrderFormMixin, self).__init__(*args, **kwargs) |
| #!/usr/bin/env bash | |
| # Clear out all previous attempts | |
| rm -rf "/tmp/source-git/" | |
| # Get the dependencies for git, then get openssl | |
| sudo apt-get install build-essential fakeroot dpkg-dev -y | |
| sudo apt-get build-dep git -y | |
| sudo apt-get install libcurl4-openssl-dev -y | |
| mkdir -p "/tmp/source-git/" |
| <dom-module id="nyaovim-app"> | |
| <template> | |
| <style> | |
| html,body { | |
| background: transparent; | |
| } | |
| @keyframes blink { | |
| 0% { |
| ''' | |
| PIL's Image.thumbnail() returns an image that fits inside of a given size (preserving aspect ratios) | |
| but the size of the actual image will vary and is certainly not guaranteed to be the requested size. | |
| This is often inconvenient since the size of the returned thumbnail cannot be predicted. The django-thumbs | |
| library solves this for square thumbnails by cropping the image to a square and then resizing it. However, | |
| this only works for exact squares. | |
| This function generalizes that approach to work for thumbnails of any aspect ratio. The returned thumbnail | |
| is always exactly the requested size, and edges (left/right or top/bottom) are cropped off to adjust to | |
| make sure the thumbnail will be the right size without distorting the image. |