This file contains 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 |
This file contains 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 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 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 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 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 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
if (shExpMatch(host, "*.dev")) { | |
return "PROXY localhost:3000"; | |
} | |
if (shExpMatch(host, "*.dev2")) { | |
return "PROXY localhost:3001"; | |
} | |
if (shExpMatch(host, "*.dev3")) { | |
return "PROXY localhost:3002"; | |
} |
This file contains 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
function Lagrange (n : Integer; | |
var x,f : vector; | |
xx : Extended; | |
var st : Integer) : Extended; | |
{---------------------------------------------------------------------------} | |
{ } | |
{ The function Lagrange calculates the value of a polynomial given by } | |
{ Lagrange's interpolation formula. } | |
{ Data: } | |
{ n - number of interpolation nodes minus 1 (the degree of polynomial } |
This file contains 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
function Neville (n : Integer; | |
x : vector; | |
xx : Extended; | |
var f : vector; | |
var st : Integer) : Extended; | |
{---------------------------------------------------------------------------} | |
{ } | |
{ The function Neville calculates the value of interpolating polynomial by } | |
{ Neville's algorithm. } | |
{ Data: } |
This file contains 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
config.around(:each) do |example| | |
Timecop.freeze if freeze_time? | |
example.run | |
Timecop.return if freeze_time? | |
end | |
def freeze_time? | |
example.metadata[:freeze_time] | |
end |
OlderNewer