| Return code | Definition |
|---|---|
| 100 | Success |
| 101 | Unknown error |
| 102 | Version not supported |
| 103 | Illegal request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lua << EOF | |
| local nvim_lsp = require'nvim_lsp' | |
| local log = require'vim.lsp.log' | |
| nvim_lsp.rust_analyzer.setup{} | |
| nvim_lsp.gopls.setup{} | |
| function lsp_go_to_definition(cmd) | |
| local params = vim.lsp.util.make_position_params() | |
| return vim.lsp.buf_request(0, 'textDocument/definition', params, function(_, method, result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[warn(unused_variables)] | |
| pub struct Letter { | |
| text: String, | |
| } | |
| impl Letter { | |
| pub fn new(text: String) -> Self { | |
| Letter { text } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.test import TestCase | |
| class ReceiverConnectionTestCase(TestCase): | |
| """TestCase that allows asserting that a given receiver is connected to a signal. | |
| Important: this will work correctly providing you: | |
| 1. Do not import or patch anything in the module containing the receiver in any django.test.TestCase. | |
| 2. Do not import (except in the context of a method) the module containing the receiver in any test module. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Transforms a normal Python file to pep484 annotations using Jedi. | |
| Usage: | |
| pep484transform.py <file> [-d] | |
| Options: | |
| -d, --debug Show Jedi's debug output. | |
| """ | |
| from os.path import abspath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| import XCPlayground | |
| // MARK: - Helpers | |
| extension UIView { | |
| func addBorderWith(color: UIColor, width: CGFloat, alpha: CGFloat = 1) { | |
| self.layer.borderColor = color.colorWithAlphaComponent(alpha).CGColor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist | |
| sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "net/http" | |
| "database/sql" | |
| "fmt" | |
| "log" | |
| "os" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
NewerOlder