Skip to content

Instantly share code, notes, and snippets.

View shiroginne's full-sized avatar
:octocat:

Yauheni Suhakou shiroginne

:octocat:
View GitHub Profile
@shiroginne
shiroginne / teh_drama.md
Last active May 25, 2023 09:39
драма с xored.com

Для тех, кто не следит за интеренетом, собрал драму в нескольких актах. ВОРНЕНГ: ссылки могут не работать, сохраняйте скриншоты.

Акт 1:

Статья на хабре https://habrahabr.ru/post/335876/ (читайте коментарии platoff)

Твиты которые могут содержать комментарии (если потёрли)

Акт 2:

Система решения математических уравнений.
Система должна состоять из 2х основных компонентов:
Фронтенд сервер.
Основной функционал
RoR приложение должно предоставлять:
а) Выбор типа уравнения (по умолчанию линейное и квадратное)
б) Форму ввода параметров для решения уравнения
@shiroginne
shiroginne / .rb
Created August 9, 2017 18:10
Rails CRUD controllers
class PostsController < ApplicationController
def index
end
def show
end
def new
end
@shiroginne
shiroginne / some_controller.rb
Last active August 9, 2017 07:35
Rails controllers example
class RootController < ApplicationController
def create_post
# some code
end
def set_rating
# some code
end
def get_top_rating_movies
@shiroginne
shiroginne / lolcat.hs
Created December 5, 2011 09:56 — forked from lest/lolcat.hs
simple lolcat powered by haskell
import Data.Word
freq = 0.3
spread = 8.0
unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> int
unbase base r g b = (fi r*base+fi g)*base+fi b
where fi = fromIntegral
-- | Approximate a 24-bit Rgb colour with a colour in the xterm256 6x6x6 colour cube, returning its index.
http://dl.ambiweb.de/mirrors/ftp.ruby-lang.org/
2.0.0 +
1.9.3 +
1.9.2 +
1.9.1 +
1.9.0 +
1.8.7 +
#application.rb
require "active_record/railtie"
#pry
[3] pry(#<Api::CheckoutsController>)> Api::CheckoutData.new
=> #<Api::CheckoutData id: nil, token: nil, shop_id: nil, transaction_type: nil, created_at: nil, updated_at: nil>
[4] pry(#<Api::CheckoutsController>)> Api::CheckoutData.new({})
NoMethodError: undefined method `safe_constantize' for nil:NilClass
from /Users/aeldreath/.rvm/gems/ruby-2.0.0-p247@global/gems/activerecord-4.0.0/lib/active_record/inheritance.rb:175:in `subclass_from_attrs'
Вторая половинка есть у жопы, таблетки и мозга, а я изначально целая!(с) Фаина Раневская
@shiroginne
shiroginne / app.js
Created August 7, 2013 20:43
ember.js app
App = Ember.Application.create();
App.Router.map(function() {
this.resource("questions", { path: '/'}, function () {
this.resource("question", { path: ':question_id'})
});
this.resource("result")
});
App.QuestionsRoute = Ember.Route.extend({
@shiroginne
shiroginne / gist:6111424
Created July 30, 2013 09:04
nexus 7 ota force update
Инструкция для ускорения ОТА:
1) Настройки - Приложения - Все - Google Services Framework.
2) Стереть данные. Остановить.
3) Затем вЫключаю Wi-fi и Apn.
4) Перезагружаюсь.
4) После перезагрузки вылезло окно "Позволить ли Гуглу определять местоположение", ответ НЕТ.
5)Включаем сеть и тут сразу предложение обновления.