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
| Capybara.javascript_driver = :webkit | |
| Capybara.server_port = 7171 | |
| def with_subdomain subdomain | |
| old_subdomain = Capybara.app_host | |
| Capybara.app_host = "http://#{subdomain}.localhost.dev:7171" | |
| yield | |
| ensure | |
| Capybara.app_host = old_subdomain | |
| end |
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 ruby | |
| # encoding: UTF-8 | |
| require 'net/http' | |
| require 'nokogiri' | |
| class GitLogs | |
| attr_accessor :raw_log, :logs | |
| def initialize old_ref, new_ref | |
| self.raw_log = `git log --no-color --format=short #{old_ref}..#{new_ref}`.force_encoding('utf-8') |
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
| #include <iostream> | |
| #include <vector> | |
| int main() { | |
| int szala1, szala2 = 0; | |
| long mnoznik = 1; | |
| std::vector<int> s1, s2; | |
| std::cin >> szala1; | |
| while(szala1 != szala2) { | |
| if((szala1%3+1)%3+1 == (szala2%3+1)%3) { |
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
| #include<iostream> | |
| int main() { | |
| int data[100][2]; | |
| int p[100]; | |
| int howmany, mass; | |
| std::cin >> howmany >> mass; | |
| for(int i=0; i<=mass; i++) p[i] = 0; | |
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
| /* classic boyer_moore find algorithm | |
| * by pewniak747@gmail.com */ | |
| #include<iostream> | |
| int boyer_moore(std::string input, std::string pattern) { | |
| int index = 0; | |
| int input_length = input.size()-1; | |
| int pattern_length = pattern.size()-1; | |
| int last[255]; |
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/ruby | |
| # tweet is a script that allows you to update | |
| # your twitter status using shell | |
| # written by Tomasz 'pewniak747' Pewiński | |
| # pewniak747@gmail.com | |
| def exp_value input | |
| input[input.index("=")+1, input.size].strip | |
| end |
NewerOlder