This file contains hidden or 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
| class AddTypusAttributesToUsers < ActiveRecord::Migration | |
| def self.up | |
| add_column :users, :role, :string | |
| add_column :users, :status, :boolean, :null=>false, :default=>true | |
| User.find(1).update_attribute(:role,'admin') | |
| end | |
| def self.down | |
| remove_column :users, :role | |
| remove_column :users, :status |
This file contains hidden or 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 -*- | |
| # Just use 'mysql2_downcase' adapter in database.yml | |
| # | |
| require 'active_record/connection_adapters/mysql2_adapter' | |
| module ActiveRecord | |
| class Base | |
| # Establishes a connection to the database that's used by all Active Record objects. | |
| def self.mysql2_downcase_connection(config) |
This file contains hidden or 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
| <script type="text/javascript"> | |
| window.art=window.art||[],art.load=function(t,r){art.appId=t,art.config=r=r||{};var e=r.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="http://cdn.1clickanalytics.ru/widget.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(t){return function(){art.push([t].concat(Array.prototype.slice.call(arguments,0)))}},c=["clearEventProperties","identify","setEventProperties","track","unsetEventProperty"],s=0;s<c.length;s++)art[c[s]]=o(c[s])},art.load("100003"); | |
| </script> |
This file contains hidden or 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
| SELECT pid, now() - query_start as duration, query, state FROM pg_stat_activity WHERE now() - query_start > interval '5 minutes'; | |
| ;; cancel | |
| SELECT pg_cancel_backend(__pid__); | |
| ;; kill stucked | |
| SELECT pg_terminate_backend(__pid__); |
This file contains hidden or 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
| # Это такой замысловатый спосбо добавить поддомен в запрос для rspec | |
| # | |
| # Использовать: | |
| # | |
| # RSpec.configure do |config| | |
| # config.include ProcessWithRequestSubdomain, type: :controller | |
| # | |
| module ProcessWithRequestSubdomain | |
| extend ActiveSupport::Concern |
This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset='utf-8' /> | |
| <style> | |
| body { | |
| font-size: 12px; | |
| } | |
| table { | |
| border-collapse: collapse; |
This file contains hidden or 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/env | |
| echo "Kill them all!!!" | |
| ps axfww | grep spring | grep "app\|server" | awk '{ print $1 }' | xargs kill -9 |
This file contains hidden or 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 на Comodo: | |
| # https://sslanalyzer.comodoca.com/?url=https%3A%2F%2Fkiiiosk.ru | |
| # Проверка на Trusted | |
| # https://www.digicert.com/help/ | |
| # source: | |
| # https://support.comodo.com/index.php?/Default/Knowledgebase/Article/View/1091/1/certificate-installation--nginx | |
| ssl_stapling on; |
This file contains hidden or 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
| var title = new PointText(new Point(200, 10)); | |
| title.content="click - установка стрелки, drug - перемещени, shift-drug - вращение" | |
| var debug = new PointText(new Point(200, 50)); | |
| var currentArrow; | |
| var raster = new Raster({ | |
| source: "https://paraquest.ru/uploads/slide/image/20/2018-11-12_21_10_04-Улет_с_Аламнера3.png", | |
| position: view.center | |
| }); |
OlderNewer