Skip to content

Instantly share code, notes, and snippets.

@ivanitskiy
ivanitskiy / main.go
Created October 26, 2018 18:41
Match strings by wildcard patterns with filepath.Match() function
package main
import (
"fmt"
"path/filepath"
)
func main() {
filename := "start.txt"
@ivanitskiy
ivanitskiy / gist:39a0bfa8db5fa9f8ae51a2923ed21105
Created February 27, 2017 06:42 — forked from stenver/gist:337aea741fe7d70ce703
How to set up windows machine for selenium and jenkins
# Setting up internet explorer machine with selenium
Download the machine with appropriate windows and IE from microsoft
https://www.modern.ie/en-us/virtualization-tools
Boot it up with GUI
Disable UAC and firewall - its an isolated machine that noone will access anyway(and if they do, theres really nothing there), so why bother
# Copssh
@ivanitskiy
ivanitskiy / Vagrantfile
Created February 27, 2017 05:13 — forked from tvjames/Vagrantfile
Prepare a Windows Server 2008 R2 instance for use with vagrant-windows.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@ivanitskiy
ivanitskiy / gist:b9bd0476ee7ef5f4bb970553538037bc
Last active February 22, 2017 06:10
feed cytoscape graph from the ajax call.
var init = function() {
//.. do some overall initialization
$.ajax({
url: '/url/',
method: 'GET',
dataType: 'json',
data: {}, //probably you have some parameters
success: displaygraph,
error: function() {alert('error getting data');}
});
@ivanitskiy
ivanitskiy / gist:c5fdddce7180dcf7bfc962e545fea1bf
Created November 15, 2016 01:18 — forked from ombre42/gist:cb6bc804c876a7f07c45
email template for Robot Framework test results
<%
import java.text.DateFormat
import java.text.SimpleDateFormat
%>
<STYLE>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
font-size:11px;
color:black;
}
@ivanitskiy
ivanitskiy / helloworld-win32-service.py
Created September 4, 2016 20:23 — forked from drmalex07/helloworld-win32-service.py
An example Windows service implemented with pywin32 wrappers. #python #windows-service #pywin32
import win32serviceutil
import win32service
import win32event
import servicemanager
import socket
import time
import logging
logging.basicConfig(
filename = 'c:\\Temp\\hello-service.log',
@ivanitskiy
ivanitskiy / goto-sublime
Created November 13, 2015 05:30 — forked from kendellfab/goto-sublime
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
@ivanitskiy
ivanitskiy / tornadobg.py
Created November 6, 2015 20:25 — forked from mivade/tornadobg.py
Background tasks with tornado and concurrent.futures
"""A simple demonstration of running background tasks with Tornado.
Here I am using a basic TCP server which handles streams and keeps
them open while asynchronously performing a fake task in the
background. In order to test it, simply telnet to localhost port 8080
and start typing things to see that the server receives the messages.
The advantage to running on an executor instead of conventional
threads is that we can more easily shut it down by stopping the
tornado IO loop.
@ivanitskiy
ivanitskiy / tornado_websocket_ee.py
Created November 6, 2015 18:11 — forked from gnpkrish/tornado_websocket_ee.py
Realtime Communicating with front-end using simple EventEmitter. With use of Tornado + Websocket.
"""
This is a simple example of WebSocket + Tornado + Simple EventEmitters usage.
Thanks to pyee by https://github.com/jesusabdullah
@Author:: Narayanaperumal G <[email protected]>
"""
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
from collections import defaultdict
@ivanitskiy
ivanitskiy / sub.py
Created November 6, 2015 18:10 — forked from FZambia/sub.py
tornado's Subprocess class usage example. Minimal Tornado's version required - 3.1
from __future__ import print_function
from tornado.gen import Task, Return, coroutine
import tornado.process
from tornado.ioloop import IOLoop
import subprocess
import time
STREAM = tornado.process.Subprocess.STREAM