Skip to content

Instantly share code, notes, and snippets.

View iSarCasm's full-sized avatar

Ihor Tsykalo iSarCasm

  • Canada
  • 22:33 (UTC -06:00)
View GitHub Profile
def find_errors
err_node = @agent.page.at(".errors")
[] << if err_node
["#{err_node.attributes['id'].value}: #{err_node.children.text}"]
end
end
class ImageValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
unless value =~ /\.(gif|jpg|png)\Z}/i
record.errors[attribute] << (options[:message] || "is not an image")
end
end
end
[1] pry(#<RSpec::ExampleGroups::CartsController::Add::WhenTryingToAddValidItem>)> controller.session
=> {}
[2] pry(#<RSpec::ExampleGroups::CartsController::Add::WhenTryingToAddValidItem>)> controller.current_cart
=> #<ShoppingCart:0x00000004e0b8a8 @items=[]>
[3] pry(#<RSpec::ExampleGroups::CartsController::Add::WhenTryingToAddValidItem>)> controller.session[:cart] = "lol"
=> "lol"
[4] pry(#<RSpec::ExampleGroups::CartsController::Add::WhenTryingToAddValidItem>)> controller.current_cart
=> "lol"
[5] pry(#<RSpec::ExampleGroups::CartsController::Add::WhenTryingToAddValidItem>)> controller.session[:cart] = nil
=> nil
@iSarCasm
iSarCasm / wtf.cs
Last active January 18, 2016 11:46
for(int y = 0; y < aHeight; y++)
{
for(int x = 0; x < aWidth; x++)
{
int basePxPosition_x = (x - offset_x);
int basePxPosition_y = (y - offset_y);
int copyPxPosition_x = basePxPosition_x - offset_w + offset_x;
int copyPxPosition_y = basePxPosition_y - offset_h + offset_y;
if (CutOff(basePxPosition_x, basePxPosition_y, aWidth, aHeight)) {
newTexturePixels[x + y*aWidth] = new Color(0, 0, 0, 0);
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <bitset>
using namespace std;
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <bitset>
using namespace std;
class BooksController < ApplicationController
def show
@book = Book.find(params[:id])
@reviews = @book.reviews.where(approved: true) || []
end
end
2 25 ext
2 45 amp
2 52 advent
3 15 amp
3 20 crucible
3 35 upgrade
4 00 3 fugue
4 15 2 advents
4 55 move out + proxy extractor
spam
рофл
https://habrahabr.ru/company/eset/blog/277675/
1. Технические средства защиты информации
http://www.niitzi.by/index.php?option=com_content&view=article&id=25:%D0%BA%D0%BE%D0%BC%D0%BF%D0%BB%D0%B5%D0%BA%D1%81%D1%8B-%D0%B7%D0%B0%D1%89%D0%B8%D1%82%D1%8B-%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%BD%D1%8B%D1%85-%D0%BF%D0%BE%D1%82%D0%BE%D0%BA%D0%BE%D0%B2&catid=20&Itemid=107&lang=ru
http://www.securitylab.ru/blog/personal/aguryanov/30011.php
2. Криптография
http://www.cryptocom.ru/articles/crypto.html
объявить А(8), В(8), рг1(16),Сч(4),См(16)
печать "введите А, В"
ввести А, В
См = 0
Сч = 8
рг1(15:8)=В(7:0)
1:
рг1 >> 1
Если А(7)=1 идти_к 2
идти_к 3