Skip to content

Commit d96dc1e

Browse files
focustime: Add focustime CLI workflows and repository structure updates (#11)
2 parents 777f485 + 89549ae commit d96dc1e

45 files changed

Lines changed: 3629 additions & 159 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
| <span style="white-space: nowrap;">📂 [gocovmerge](./gocovmerge/README.md)</span> | Go coverage profile merger with modern CLI features |
1212
| <span style="white-space: nowrap;">📂 [mdtoc](./mdtoc/README.md)</span> | Markdown table of contents (TOC) generator |
1313
| <span style="white-space: nowrap;">📂 [winfixtext](./winfixtext/README.md)</span> | Fixes Windows encoding issues and corrupted LLM text outputs |
14-
| <span style="white-space: nowrap;">📂 [bash-ts](./bash-ts/README.md)</span> | Production TypeScript scripting library (bun install `@uniquedivine/bash`) for robust scripts with Bun runtime |
15-
| <span style="white-space: nowrap;">📂 [ud-jiyuu](./ud-jiyuu/README.md)</span> | TypeScript package mimicking Rust/Go functionality |
14+
| <span style="white-space: nowrap;">📂 [ts-pkg/bash](./ts-pkg/bash/README.md)</span> | Production TypeScript scripting library (bun install `@uniquedivine/bash`) for robust scripts with Bun runtime |
15+
| <span style="white-space: nowrap;">📂 [ts-pkg/jiyuu](./ts-pkg/jiyuu/README.md)</span> | TypeScript package mimicking Rust/Go functionality |
1616
| <span style="white-space: nowrap;">📂 [discord-nibiru](./discord-nibiru/README.md)</span> | Discord moderation bot for Nibiru community |
1717
| <span style="white-space: nowrap;">📦 scripts</span> | Scripts crate in Rust |
1818
| <span style="white-space: nowrap;">├── justfile</span> | Runs project-specific commands |

algos/000_dfs/log.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 000
2+
3+
TODO
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package algos
22

3+
import (
4+
"github.com/stretchr/testify/suite"
5+
"testing"
6+
)
7+
38
// Given an array of integers `nums` and an integer `target`, return indices of
49
// the two numbers such that they add up to `target`.
510
//
@@ -43,6 +48,12 @@ func Sol1(nums []int, target int) [2]int {
4348
return [2]int{-1, -1}
4449
}
4550

51+
type S struct{ suite.Suite }
52+
53+
func Test(t *testing.T) {
54+
suite.Run(t, new(S))
55+
}
56+
4657
func (s *S) Test1_TwoSum() {
4758
type testCase struct {
4859
nums []int

algos/001_two_sum/log.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Ex 001: Two Sum
2+
3+
Practice Problem:
4+
5+
Given an array of integers `nums` and an integer `target`, return indices of
6+
the two numbers such that they add up to `target`.
7+
8+
You may assume that each input would have exactly one solution, and you may
9+
not use the same element twice.
10+
11+
```
12+
Example 1:
13+
Input: nums = [2,7,11,15], target = 9
14+
Output: [0,1]
15+
Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].
16+
17+
Example 2:
18+
Input: nums = [3,2,4], target = 6
19+
Output: [1,2]
20+
21+
Example 3:
22+
Input: nums = [3,3], target = 6
23+
Output: [0,1]
24+
```
25+
26+
Source Info:
27+
- This is [Leetcode 1: Two Sum](https://leetcode.com/problems/two-sum/)
28+
29+
Q: Describe the solution in words.
30+
31+
- Inputs have exactly one solution -> there's guaranteed to be a correct answer.
32+
- Cannot use same element twice -> [0, 0] is not a valid answer, even if it
33+
evaluates to the target.
34+
35+
- .x
36+
- .x
37+
- .x
38+

algos/002_remove_element_test.go renamed to algos/002_remove_element/002_remove_element_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package algos
22

3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/suite"
7+
)
8+
39
// Given an integer array `nums` and an integer `val`, remove all occurrences of
410
// `val` in `nums` in-place. The order of the elements may be changed. Then return
511
// the number of elements in nums which are not equal to `val`.
@@ -29,6 +35,12 @@ package algos
2935
// ```
3036
// If all assertions pass, then your solution will be accepted.
3137

38+
type S struct{ suite.Suite }
39+
40+
func Test(t *testing.T) {
41+
suite.Run(t, new(S))
42+
}
43+
3244
// Sol2: Pushes all "val" elements to the back of "nums".
3345
//
3446
// Args:

algos/002_remove_element/log.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Ex 002: Remove Element
2+
3+
Practice Problem:
4+
5+
Given an integer array `nums` and an integer `val`, remove all occurrences of
6+
`val` in `nums` in-place. The order of the elements may be changed. Then return
7+
the number of elements in nums which are not equal to `val`.
8+
9+
Consider the number of elements in nums which are not equal to `val` be `k`, to
10+
get accepted, you need to do the following things:
11+
- Change the array `nums` such that the first `k` elements of `nums` contain the
12+
elements which are not equal to `val`. The remaining elements of `nums` are not
13+
important as well as the size of `nums`.
14+
- Return k.
15+
16+
Custom Judge:
17+
The judge will test your solution with the following code:
18+
```
19+
int[] nums = [...]; // Input array
20+
int val = ...; // Value to remove
21+
int[] expectedNums = [...]; // The expected answer with correct length.
22+
// It is sorted with no values equaling val.
23+
24+
int k = removeElement(nums, val); // Calls your implementation
25+
26+
assert k == expectedNums.length;
27+
sort(nums, 0, k); // Sort the first k elements of nums
28+
for (int i = 0; i < actualLength; i++) {
29+
assert nums[i] == expectedNums[i];
30+
}
31+
```
32+
If all assertions pass, then your solution will be accepted.
33+
34+
Source Info:
35+
- [Leetcode 27: Remove Element](https://leetcode.com/problems/remove-element/description/)
36+
- Topics: \[Array, Two Pointers\]
37+
38+
A:
39+
Impl in 002_remove_element_test.go
40+

algos/003_move_zeros_test.go renamed to algos/003_move_zeros/003_move_zeros_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package algos
22

3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/suite"
7+
)
8+
39
// Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.
410
//
511
// Note that you must do this in-place without making a copy of the array.
@@ -26,3 +32,9 @@ func Sol3(nums []int) {
2632
writeIdx++
2733
}
2834
}
35+
36+
type S struct{ suite.Suite }
37+
38+
func Test(t *testing.T) {
39+
suite.Run(t, new(S))
40+
}

algos/003_move_zeros/log.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
### Ex 003: Move Zeros
2+
3+
Practice Problem:
4+
5+
Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.
6+
7+
Note that you must do this in-place without making a copy of the array.
8+
9+
```
10+
Example 1:
11+
Input: nums = [0,1,0,3,12]
12+
Output: [1,3,12,0,0]
13+
14+
Example 2:
15+
Input: nums = [0]
16+
Output: [0]
17+
```
18+
19+
Source Info:
20+
- [Leetcode 283: Move Zeros](https://leetcode.com/problems/move-zeroes/)
21+
- Topics: \[Array, Two Pointers\]
22+
23+
A:
24+
Impl in 003_move_zeros_test.go

0 commit comments

Comments
 (0)