This file contains 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 ( | |
"bufio" | |
"os" | |
"strings" | |
) | |
func main() { | |
reader := bufio.NewReader(os.Stdin) |
This file contains 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" | |
) | |
func printBytes(s string) { | |
for i:= 0; i < len(s); i++ { | |
fmt.Printf("%x ", s[i]) | |
} |
This file contains 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" | |
) | |
func printBytes(s string) { | |
for i:= 0; i < len(s); i++ { | |
fmt.Printf("%x ", s[i]) | |
} |
This file contains 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" | |
) | |
func mutate(s []rune) string { | |
s[0] = 'a' | |
return string(s) | |
} |
This file contains 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
#!/bin/sh | |
# Remove folder that contains other files or directories | |
rm -r mydir | |
# Avoid getting the delete confirmation for each file | |
rm -rf mydir |
This file contains 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
#!/bin/bash | |
# This will create icons in their respective | |
# folders in "$HOME"/.local/share/icons/... | |
# Usage: icongen iconfile | |
# Check usage | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: $0 icon_file new_icon_name" |
This file contains 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
@Component({ | |
selector: 'simple-check-option', | |
template: ` | |
<label> | |
<input type="checkbox" [formControl]="control"> | |
{{ label }} | |
</label> | |
` | |
}) | |
export class SimpleCheckOptionComponent { |
This file contains 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
<multi-check-field> | |
<simple-check-option *ngFor="let option of options" [value]="option" | |
[label]="option.label"> | |
</single-check-option> | |
</multi-check-field> |
This file contains 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
@Component({ | |
selector: 'multi-check-field', | |
template: `<ng-content></ng-content>` | |
}) | |
export class MultiCheckFieldComponent implements AfterContentInit { | |
@ContentChildren(SimpleCheckOptionComponent) | |
options!: QueryList<SimpleCheckOptionComponent>; | |
ngAfterContentInit(): void { |
OlderNewer