Fedora BCC Example
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
| #include<iostream> | |
| using namespace std; | |
| struct node { | |
| int data; | |
| node *next; | |
| }; | |
| int main() { |
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
| <div id="el"></div> | |
| <!-- using string template here to work around HTML <option> placement restriction --> | |
| <script type="text/x-template" id="demo-template"> | |
| <div> | |
| <p>Selected: {{ selected }}</p> | |
| <select2 :options="options" v-model="selected"> | |
| <option disabled value="0">Select one</option> | |
| </select2> | |
| </div> |
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
| macro_rules! A { | |
| (1+ $input:expr) => { | |
| $input + 1 | |
| }; | |
| (2+ $input:expr) => { | |
| $input + 2 | |
| }; | |
| } | |
| fn main() { |
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
| set nocompatible " be iMproved, required | |
| filetype off " required | |
| syntax on | |
| let g:python3_host_prog = '/Users/weli/.pyenv/versions/3.8.5/bin/python' | |
| let g:python_host_prog = '/Users/weli/.pyenv/versions/2.7.18/bin/python' | |
| nmap <C-n> :NERDTreeToggle<CR> | |
| " Specify a directory for plugins | |
| " - For Neovim: stdpath('data') . '/plugged' |
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
| JS Snippets |
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
| struct Foo { | |
| x: i32, | |
| s: String, | |
| opt: Option<i32>, | |
| } | |
| struct Bar(i32, i32); | |
| fn play_with_struct() -> Foo { | |
| let d = Foo { |
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
| type Callback = fn(); | |
| struct Processor { | |
| callback: Callback, | |
| } | |
| impl Processor { | |
| fn process_event(&self) { | |
| (self.callback)(); | |
| } |
The root cause is because JSONB can't unmarshall an interface.
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
| // 关于by value和by reference | |
| fn main() { | |
| let x = String::from("hi"); | |
| let y = &x; | |
| println!("{}", y); | |
| let z = { | |
| let _z = String::from("42"); | |
| _z |