Skip to content

Instantly share code, notes, and snippets.

from inspect import getargspec
from types import FunctionType
from your_module import (a_method
another_method,
and_so_on)
class ExampleDynamicLibrary(object):
def __init__(self):
alias robot_clean="find . \( -name log.html -or -name report.html -or -name output.xml -or -name debug.log -or -name \"*-screenshot-*.png\" \) -exec rm -rf {} \;"
param([string]$folder)
$command="$args"
$filter = "*.*"
$Watcher = New-Object IO.FileSystemWatcher $folder, $filter -Property @{
IncludeSubdirectories = $true
EnableRaisingEvents = $true
}
Register-ObjectEvent $Watcher Changed -SourceIdentifier Watcher -Action {
$command=$event.MessageData
<snippet>
<content><![CDATA[\${${SELECTION}}]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<!-- keymap:
@Tattoo
Tattoo / gist:d5cd0cc8759f3ea3dce84fba207f2a07
Created September 17, 2017 22:17
Chrome empty page that you can write on
data:text/html, <html contenteditable>
""" test.robot
*** Settings ***
Library OrchestrationLibrary
*** Test Cases ***
Configuration
[Tags] configuration
Trigger on Some condition Test 1
Trigger on Some condition test 2
Trigger on Other condition Test 2
property default_minutes : 30
property wait_percent : 50 -- wait before starting fade
set question to "Set a sleep timer for how many minutes?"
set options to {"Don't sleep after", "Sleep after", "Cancel"}
display dialog question default answer default_minutes ¬
buttons options default button 1 giving up after 30
set {_button, _answer} to {button returned, text returned} of result
@Tattoo
Tattoo / gist:5f0097f9c422f7b7c3491ec464d73fff
Created August 1, 2018 05:28
"Open iTerm here" context menu for Finder in OS X
# Step 1
# Open Automator
#
# Step 2
# File - New - Service
#
# Set the top dropdown boxes to Service receives selected files or folders in Finder.app
# Double click or drag Run Shell Script from the left panel, and enter the following:
if [[ -d $1 ]]; then
@Tattoo
Tattoo / script.sh
Last active November 27, 2018 09:33
Bash: Disabling output of "set -x" for one command
### 'set -x' is wonderful if you want to see the command as well as output in a script
function example {
echo "${1}"
}
VAR="foo"
set -x
example "${VAR}"
# + example foo
@Tattoo
Tattoo / self-validating.sql
Created November 1, 2018 15:10
Self-validating SQL queries for interactive
-- https://stackoverflow.com/a/754570
SELECT CONCAT(
'Sufficient and sufficiently varied month_value test data: ',
CASE WHEN (
SELECT COUNT(DISTINCT y, m) FROM month_value
) > 10
AND (
SELECT COUNT(DISTINCT y) FROM month_value
) > 3