Skip to content

Instantly share code, notes, and snippets.

Avatar

Volodymyr Shatskyi vlad-shatskyi

View GitHub Profile
View _answer.html.erb
<li>
<%= ('a'.ord + answer_counter).chr >) <%= answer.content %>
</li>
@vlad-shatskyi
vlad-shatskyi / .zshrc
Last active Dec 11, 2015
ZSH config
View .zshrc
autoload -U colors && colors
autoload -Uz compinit && compinit
PROMPT="%{$fg[blue]%}%~ ▶%{$reset_color%} "
export TERM="xterm-256color"
export EDITOR='vim'
export CLICOLOR=1
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true"
alias l='ls'
@vlad-shatskyi
vlad-shatskyi / e75.cpp
Created Aug 10, 2012
Problem 75, rev.2
View e75.cpp
#include <iostream>
#include <vector>
#include <map>
#include <thread>
#include <mutex>
#include <algorithm>
#include <iomanip>
using namespace std;
const long limit = 1500000;
View e75.cpp
#include <iostream>
#include <vector>
#include <map>
#include <thread>
#include <mutex>
#include <algorithm>
#include <iomanip>
using namespace std;
const long limit = 1500000;
View gist:3156936
total = 0
next_order = 10
length = 1
while True:
result_of_power = 0
base = 1
list_of_powers = []
while result_of_power < next_order:
result_of_power = base**length
list_of_powers.append(result_of_power)
View simplepastiefile.m
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> text;
string word;
while (cin >> word) {
View simplepastiefile.m
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> text;
string word;
while (cin >> word) {
View gist:21cb6e526d8e397c4da4
module Scraper::BookingCom
class RoomBot < BotBase
include Scraper::ScrapingCommon
HTTP_RESPONSE_VALIDATORS = [
:nil_response, :status_404, :status_200, :html,
->(url, resp) { raise(CustomExceptions::InvalidUrlError, url) if resp.uri.path.include?("searchresults") }
]
def scrape
View gist:bcd5fdacc740435f704c
module Scraper::BookingCom
class RoomBot < BotBase
include Scraper::ScrapingCommon
HTTP_RESPONSE_VALIDATORS = [
:nil_response, :status_404, :status_200, :html,
->(url, resp) { raise(CustomExceptions::InvalidUrlError, url) if resp.uri.path.include?("searchresults") }
]
def scrape
View ask
module Main where
import System.Environment
import System.IO (hFlush, stdout)
ask :: (Show a, Read b) => a -> IO b
ask question = do
putStr $ show question
hFlush stdout
answer <- getLine