Skip to content

Instantly share code, notes, and snippets.

@rchl
rchl / gist:2018007
Created March 11, 2012 20:15
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
xx_xxxxxxx::xxxxxxx(xxxx = (xx_xxxxxxx * xxxxx) 0xxxx3x38,xxxxxxxx = (xx_xxxxxxxx &) @0xxxxxx568: {
xxxxxx_xxxx_xxxxxxx = 0x0,
xxxxxx_xxxxx = 0x0,
xxxxxxx = 0x178869x0,
xxxxxxx = 0xxxxxx638,
xxxxxx_xxxxxx = 0x19010010,
xxxxxx = 0xxxxxx1x8,
xxxxxxxx = xx_xxxxxxxx::xxxxxxxx_xxxxxxxx,
xxxxx_xxxxxx = 0xx6x2xx8,
xxxxx_xxxx = 0xx6x1xx8,
@rchl
rchl / main.cpp
Created April 29, 2012 19:07
template
#include <stdio.h>
extern void print1();
extern void print2();
int main()
{
printf("Two values printed below should be different?\n");
print1();
print2();
@rchl
rchl / gist:3290435
Created August 7, 2012 23:16
libclang crashes on compiling
Process: Sublime Text 2 [31360]
Path: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
Identifier: com.sublimetext.2
Version: Build 2218 (2218)
Code Type: X86-64 (Native)
Parent Process: launchd [259]
User ID: 501
Date/Time: 2012-08-08 01:14:43.155 +0200
OS Version: Mac OS X 10.8 (12A269)
// Activate window with specified title.
//
#include <iostream>
#include <windows.h>
using namespace std;
int main(int argc, char* argv[])
{
@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
<!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>
/*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' }}
]
@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" />
   
@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