Skip to content

Instantly share code, notes, and snippets.

@rchl
rchl / 4083.md
Last active August 19, 2020 11:36

4083

This list shows how much time each plugin has taken to respond to each event:

on_activated:
    Default.history_list: 0.001s total, mean: 0.000s, max: 0.000s
    FuzzyFileNav.fuzzy_file_nav: 0.000s total, mean: 0.000s, max: 0.000s
    GitSavvy.common.global_events: 0.001s total, mean: 0.000s, max: 0.000s
    GitSavvy.core.commands.commit: 0.000s total, mean: 0.000s, max: 0.000s
@rchl
rchl / 4081.md
Last active August 19, 2020 11:36

4081

This list shows how much time each plugin has taken to respond to each event:

on_activated:
    Default.history_list: 0.001s total, mean: 0.000s, max: 0.000s
    FuzzyFileNav.fuzzy_file_nav: 0.000s total, mean: 0.000s, max: 0.000s
    GitSavvy.common.global_events: 0.000s total, mean: 0.000s, max: 0.000s
    GitSavvy.core.commands.commit: 0.000s total, mean: 0.000s, max: 0.000s
import sublime
import sublime_plugin
import time
from threading import Thread, Lock, current_thread
def debug(msg):
print('[%s] [%s] %s' % (time.strftime('%H:%M:%S'), current_thread().name, msg))
import sublime
import sublime_plugin
class ExampleCommand(sublime_plugin.WindowCommand):
def run(self):
def open_tab():
sublime.run_command('new_window')
sublime.active_window().open_file(__file__)
window = sublime.active_window()
@rchl
rchl / _test-threading.py
Last active April 17, 2020 08:53
Test threading and locks in Sublime plugin
import sublime
import time
import os
from threading import Thread, Condition, Lock, current_thread
def debug(msg):
print('[%s] [%s] %s' % (time.strftime('%H:%M:%S'), current_thread().name, msg))
@rchl
rchl / augment_plugin_profile.py
Last active August 11, 2020 05:20
Sublime Text plugin for highlighting biggest offenders in Plugin Event Profile page
import sublime
import sublime_plugin
import re
class PluginEventProfileListener(sublime_plugin.ViewEventListener):
def on_activated_async(self):
view = self.view
if not view.is_scratch() or not view.name() or view.name() != 'Plugin Event Profile':
return
@rchl
rchl / nodon_ha.md
Last active May 5, 2022 15:09
Enable NodOn Z-Wave 4 button wall switch (CWS-3-1-01) in Home Assistant

Home assistant doesn't properly support Central Scene events currently. This is how to make it recognize those events.

  1. Stop home assistant (From the UI, otherwise it might restart automatically).
  2. In zwcfg_0x*xml file in configuration folder, in block for NodOn switch (search for name="NodOn"), replace <CommandClass id="91" name="COMMAND_CLASS_CENTRAL_SCENE"... block with:
            <CommandClass id="91" name="COMMAND_CLASS_CENTRAL_SCENE" version="1" request_flags="4" innif="true" scenecount="4">
                <Instance index="1" />
                <Value type="int" genre="system" instance="1" index="0" label="Scene Count" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="4" />
                <Value type="int" genre="user" instance="1" index="1" label="Button 1" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0" />
   
/*eslint-disable no-undef*/
import { createMatcher } from '../../../src/create-matcher'
const routes = [
{ path: '/', name: 'home', component: { name: 'home' }},
{ path: '/foo', name: 'foo', component: { name: 'foo' }},
{ path: '/baz/:testparam', name: 'baz', component: { name: 'baz' }},
{ path: '*', name: 'catch-all', props: true, component: { name: 'notFound' }}
]
<!doctype html>
<html>
<body>
<a href="http://ipv4.download.thinkbroadband.com/200MB?1.zip">Link 1</a>
<a href="http://ipv4.download.thinkbroadband.com/200MB?2.zip">Link 2</a>
<a href="http://ipv4.download.thinkbroadband.com/200MB?3.zip">Link 3</a>
<a href="http://ipv4.download.thinkbroadband.com/200MB?4.zip">Link 4</a>
<a href="http://ipv4.download.thinkbroadband.com/200MB?5.zip">Link 5</a>
<a href="http://ipv4.download.thinkbroadband.com/200MB?6.zip">Link 6</a>
</body>
@rchl
rchl / lldb_cheat_sheet.md
Last active March 16, 2016 10:46 — forked from ryanchang/lldb_cheat_sheet.md
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type