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
| #!/usr/bin/env bash | |
| log="/tmp/kitty-nvim-selection.log" | |
| log() { | |
| printf '[%s] %s\n' "$(date '+%y-%m-%d %h:%m:%s')" "$*" >>"$log" | |
| } | |
| # log "=== script started ===" | |
| # log "tty: $(tty 2>&1)" |
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
| _NVR_REAL_NVIM="$(command -v nvim)" | |
| nvim() { | |
| local code_dir="$HOME/code" | |
| # Outside ~/code → use the real nvim. | |
| if [[ "$PWD" != "$code_dir"/* ]]; then | |
| command nvim "$@" | |
| return $? | |
| fi | |
| # First directory under ~/code is the project. |
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
| class UnionJoin: | |
| def __init__(self,n): | |
| # parent node point to itself | |
| self.parent = [i for i in range(n)] | |
| self.size = [0 for _ in range(n)] | |
| self.count = n | |
| def union(self,p, q): | |
| # parent of p is parent of parent of q | |
| parent_p = self.find_parent(p) |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Iframe Example</title> | |
| </head> | |
| <body> | |
| <iframe | |
| id="inner-iframe" | |
| style="position: absolute; left: 500px; top: 200px; pointer-events: none" | |
| > |
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 ( | |
| "context" | |
| "fmt" | |
| "time" | |
| ) | |
| func handle(ctx context.Context, name string) { | |
| for { |
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 ( | |
| "context" | |
| "fmt" | |
| "time" | |
| "github.com/redis/go-redis/v9" | |
| ) |
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 "sync" | |
| func main() { | |
| } | |
| func fanIn( | |
| done <-chan interface{}, | |
| channels ...<-chan 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
| package main | |
| import "fmt" | |
| type IRepo interface { | |
| Get() string | |
| } | |
| type Repo struct { | |
| Name string |
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
| <?php | |
| global $conn; | |
| // Hàm kết nối database | |
| function connect_db() | |
| { | |
| // Gọi tới biến toàn cục $conn | |
| global $conn; | |
| // Nếu chưa kết nối thì thực hiện kết nối |
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
| <!-- <?php | |
| require 'students.php'; | |
| $students = get_all_students(); | |
| disconnect_db(); | |
| ?> --> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Danh sách cong ty</title> |
NewerOlder