Skip to content

Instantly share code, notes, and snippets.

Lukas Holecek hluk

Block or report user

Report or block hluk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hluk
hluk / CopyQ - Move Items to Other Tab.ini
Last active Aug 29, 2015
CopyQ 2.3.0 user commands to move selected items to next or previous tab
View CopyQ - Move Items to Other Tab.ini
[Commands]
1\Name=Move To Next Tab
1\Command="
copyq:
how = +1
source = selectedtab()
tabs = tab()
i = tabs.indexOf(source)
j = (i + tabs.length + how) % tabs.length
@hluk
hluk / CopyQ - Edit File.ini
Last active Mar 7, 2016
CopyQ - Edit File
View CopyQ - Edit File.ini
[Command]
Name=Edit File
Match=^([a-zA-Z]:[\\\\/]|~|file://|%\\w+%|$\\w+|/)
Command="
copyq:
var editor = config('editor')
var fileName = str(input())
.replace(/^\\/([a-zA-Z])\\//, '$1:/')
.replace(/^file:\\/\\//, '')
@hluk
hluk / CopyQ - Save As.ini
Last active Mar 24, 2017
CopyQ - Save Item/Clipboard To a File
View CopyQ - Save As.ini
[Command]
Command="
copyq:
var suffices = {
'image/svg': 'svg',
'image/png': 'png',
'image/jpeg': 'jpg',
'image/jpg': 'jpg',
'image/bmp': 'bmp',
'text/html': 'html',
@hluk
hluk / CopyQ - Store Copy Time.ini
Last active Mar 24, 2017
CopyQ - Store Copy Time
View CopyQ - Store Copy Time.ini
[Command]
Automatic=true
Command="
copyq:
var item = unpack(input())
item['application/x-copyq-time'] = dateString('yyyyMMddhhmmss')
write(0, \"application/x-copyq-item\", pack(item))"
Icon=\xf017
Input=application/x-copyq-item
Name=Store Copy Time
@hluk
hluk / CopyQ - Save Texts on Disk.ini
Last active Mar 24, 2017
CopyQ - Save Texts on Disk
View CopyQ - Save Texts on Disk.ini
[Command]
Name=Save Texts from Tab
Command="
copyq:
function encodeFileName(name)
{
return name.replace(/\\s/g, '_').replace(/\\W/g, '')
}
function addFileNamePart(fileName, item, mime)
@hluk
hluk / CopyQ - Undoable Move to Trash.ini
Last active Mar 24, 2017
CopyQ 2.3.0 user commands to move items to trash and undo the removal
View CopyQ - Undoable Move to Trash.ini
[Commands]
1\Name=Move to Trash (Undoable)
1\Command="
copyq:
trash_tab = \"(trash)\"
tab_mime = \"application/x-copyq-user-tab\"
index_mime = \"application/x-copyq-user-index\"
time_mime = \"application/x-copyq-user-time\"
@hluk
hluk / CopyQ - Synchronize Clipboard with Other Sessions.ini
Created Dec 21, 2015
CopyQ - Synchronize Clipboard with Other Sessions
View CopyQ - Synchronize Clipboard with Other Sessions.ini
[Command]
Automatic=true
Command="
copyq:
// Select session to send data to.
var sessions = [
\"my_session_2\",
\"my_session_3\",
\"my_session_4\",
]
@hluk
hluk / CopyQ - Snippets.ini
Last active Mar 24, 2017
CopyQ - Dialog for Pasting Snippets
View CopyQ - Snippets.ini
[Command]
Command="
copyq:
var snippetsTabName = 'Snippets'
function newVarRe(content) {
return new RegExp('\\\\${' + content + '}', 'g')
}
function getText(item) {
View pdc_client.py
class PDCClientWrapper(object):
def __init__(self, client, page_size):
self.client = client
self.page_size = page_size
def __call__(self, *args, **kwargs):
if 'page_size' not in kwargs:
kwargs['page_size'] = self.page_size
return self.client(*args, **kwargs)
@hluk
hluk / CopyQ - Search All Tabs.ini
Created Nov 19, 2015
CopyQ - Search All Tabs
View CopyQ - Search All Tabs.ini
[Command]
Name=Search All Tabs
Command="
copyq:
// Name for tab for storing matching items.
var search_tab_name = \"Search\"
// Returns true iff item at index matches regex.
function item_matches(item_index, re)
{
You can’t perform that action at this time.