- Learned how to search for files in VSC. Need to use
cmmd+P
- The
config.js
is king - For the
config.js
stuff to come to an affect, you need to dogatsby develop
again. gatsby build
doesn't work locally. Not sure what it does. ?????- The location of media assets are under the
static/media
not sure why it's in there. For more see https://www.gatsbyjs.com/docs/how-to/images-and-media/static-folder/
Great video on stdin vs stdout: https://www.youtube.com/watch?v=OsErpB0-mWY
As a standard your input usually comes from the keyboard. Ex cat file.txt
. <- here you're passing file.txt
as a parameter.
However you can do cat < $file_name
i.e. make the input to the cat
command a variable.
Both cat file.txt
& cat < file.txt
achieve the same, but through different mechanics. <
is passing something as an input.
I suppose it's because the cat
command has abilities to handle file names as arguments and through stdin
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
// https://www.hackingwithswift.com/articles/119/codable-cheat-sheet | |
import Foundation | |
struct Packet: Decodable { | |
var value: Int | |
var array: [Packet]? | |
} | |
enum Lett { | |
indirect case a(m: M) |
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
/* | |
ATTENTION: I've added two files here. | |
Steps to find this yourself. | |
1. Xcode >> Find >> New Scope >> Set the 'Search the following locations:' to SDK; Then set the other dropdown to 'iOS <whateverVersion>' | |
2. Then search for the error code number. | |
*/ |
Find all file names that start with 'App'
find path/to/folder -name "App*"
Show the next 3 lines (trailing context) after a match
cat Foo.swift | grep -A 3 methodA
There are some nuances. Took me a bit to piece it all together.
- Just add an if condition at the end of your existing global
.gitconfig
at your root directory.
[includeIf "gitdir:~/something/personal/"]
path = .gitconfig-personal
[includeIf "gitdir:~/elsewhere/work/"]
path = .gitconfig-work
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
// Code inside modules can be shared between pages and other source files. | |
public class BinaryNode { | |
public var val: Int | |
public var left: BinaryNode? | |
public var right: BinaryNode? | |
public init() { self.val = 0 | |
self.left = nil | |
self.right = nil | |
} |
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
func lcs(_ t1: [Character], _ t2: [Character]) -> Int { | |
// 1. build and default grid to 0 | |
let row = Array(repeating: 0, count: t2.count) | |
var grid = Array(repeating: row, count: t1.count) | |
func lcs(_ s: Stage) -> Int { | |
// 3. Exit with a 0 for any point that's beyond the left or bottom edges | |
guard s.s1 >= 0 && s.s2 >= 0 else { | |
return 0 | |
} |
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
/// start from m * n. Use RECURSION. End at 0 * 0 | |
/// out of bounds could be the top and left edges. | |
func lcs(_ t1: [Character], _ t2: [Character]) -> Int { | |
var cache: [Stage: Int] = [:] | |
func helper(_ s: Stage) -> Int { | |
if let cached = cache[s] { | |
return cached | |
} | |