Skip to content

Instantly share code, notes, and snippets.

View lisovskyvlad's full-sized avatar

Lisovskii Vladislav lisovskyvlad

View GitHub Profile
@lisovskyvlad
lisovskyvlad / download-url-to-file.rb
Created February 29, 2016 15:52 — forked from johnjohndoe/download-url-to-file.rb
Ruby script to download a number of files from individual URLs via HTTP/HTTPS/FTP specified in an external file.
#!/usr/bin/env ruby
#
# Ruby script to download a number of files
# from individual URLs via HTTP/HTTPS/FTP
# specified in an external file.
#
# Author: Tobias Preuss
# Revision: 2013-04-18 16:26 +0100 UTC
# License: Creative Commons Attribution-ShareAlike 3.0 Unported
@lisovskyvlad
lisovskyvlad / application.js
Created November 23, 2015 23:56 — forked from lexmag/application.js
Rails streaming
//= require jquery
//= require jquery_ujs
$(function() {
var source = new EventSource('/stream');
source.addEventListener('counter', function(e) {
$('body').after(e.data + '<br />');
});
});
@lisovskyvlad
lisovskyvlad / counter.rb
Created November 23, 2015 23:56 — forked from lexmag/counter.rb
Terribly simple Sinatra streaming
require 'sinatra'
set server: :thin
get '/' do
erb :welcome
end
get '/stream', provides: 'text/event-stream' do
stream do |out|
loop do
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
// SHA Hash presence web server.
//
// Requires a file containing sorted sha1s in binary form (20 bytes each).
package main
import (
"encoding/hex"
"fmt"
"io/ioutil"
@lisovskyvlad
lisovskyvlad / proxy.rb
Created January 10, 2014 22:25 — forked from gazay/proxy.rb
# Based on https://gist.github.com/74107 by # Copyright (C) 2009 Torsten Becker <torsten.becker@gmail.com>
#
# Rewrited by gazay
require 'socket'
require 'uri'
class Proxy
attr_accessor :socket