Skip to content

Instantly share code, notes, and snippets.

class SeachMixin():
def _fillSeach(whatSeach):
self.path.xpath(self.SEACH_XPATH).text = whatSeach
def _clickButton():
self.path.xpath(self.SEACH_XPATH_BUTTON).click()
def seach(whatSeach):
self._fillSeach(whatSeach)
self._clickButton()
export default function createWebSocketMiddleware(url) {
var ws
var connected = false
return ({ dispatch }) => (next) => (action) => {
const {type} = action
if (type === "SEND_WS" && connected) {
try {
ws.send(action.payload)
} catch(e) {
@pyatil
pyatil / zagrunner
Created March 9, 2014 14:30
run something command into sublime with dynamic variable
import sublime, sublime_plugin
class ZagRunner(sublime_plugin.WindowCommand):
def run(self, **kwarg):
host_args ={
"type": "telnet",
"encoding": "utf8",
"host":"192.168.23.1",
"port": 5222,
"syntax": "Packages/Python/Python.tmLanguage"
[
{
"keys": ["ctrl+w"],
"command": "run_multiple",
"args": {
"commands": [
{"command": "find_under_expand", "args": null, "context": "window"},
{"command": "show_panel", "args": {"panel": "find"}, "context": "window"}
]
}
@pyatil
pyatil / git_prompt.py
Last active January 1, 2016 16:19
prompt for status git
#/usr/bin/python
# coding: utf-8
"""
prompt for status git
"""
import re
import sh
class my_err_out():
def __init__(self):
self.merr = ''
@pyatil
pyatil / 0_reuse_code.js
Created December 26, 2013 12:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Number::pad = (digits, signed) ->
s = Math.abs(@).toString()
s = "0" + s while s.length < digits
(if @ < 0 then "-" else (if signed then "+" else "")) + s
Date.months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]
Date.weekdays = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]
Date.formats =
"a": -> Date.weekdays[@getDay()].substring(0, 3)