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 assert | |
| import ( | |
| "errors" | |
| "reflect" | |
| "regexp" | |
| "testing" | |
| ) | |
| func Equal[T any](t *testing.T, got, want T) { |
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
| function __fish_complete_aws | |
| env COMP_LINE=(commandline -pc) aws_completer | tr -d ' ' | |
| end | |
| complete -c aws -f -a "(__fish_complete_aws)" |
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
| # Put this in ~/.config/fish/completions | |
| function __fish_complete_databricks | |
| set -l cl (commandline -pc) | |
| set -l help_command (echo $cl | sed 's/[[:alnum:]-]*$/--help/') | |
| if string match -r -- '--?\w*' $cl | |
| # complete options | |
| eval $help_command \ | |
| | sed -e '1,/Options:/ d' -e '/Commands:/,$ d' \ |
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
Show hidden characters
| { | |
| "folders": | |
| [ | |
| { | |
| "path": "/path/to/project", | |
| "folder_exclude_patterns": [ | |
| ".vscode", | |
| "tmp", | |
| "vendor/bundle", | |
| "log" |
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 ( | |
| "bufio" | |
| "bytes" | |
| "encoding/binary" | |
| "errors" | |
| "io" | |
| ) |
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/libexec/PlistBuddy -c "set AppleSymbolicHotKeys:34:enabled bool false" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
| /usr/libexec/PlistBuddy -c "set AppleSymbolicHotKeys:35:enabled bool false" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
| /usr/libexec/PlistBuddy -c "set AppleSymbolicHotKeys:37:enabled bool false" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
| # 34 and 35 might not exists. Add them. | |
| /usr/libexec/PlistBuddy -c "add AppleSymbolicHotKeys:34:enabled bool false" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
| /usr/libexec/PlistBuddy -c "add AppleSymbolicHotKeys:35:enabled bool false" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
| # Restart your computer. Log out then log in did not work for me. |
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
| #!/bin/sh | |
| # Print $PWD where parent directories are abbreviated to their first letters. | |
| # $HOME is replaced with ~. | |
| # Based on: https://unix.stackexchange.com/a/26885 | |
| sed -e "s:$HOME:~:" -e 's:\([^/]\)[^/]*/:\1/:g' <<<$PWD | |
| # PWD=/home/me/foo/bar/baz | |
| # => ~/f/b/baz |
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
| # Drop this into app/helpers and then in your views: | |
| # | |
| # <%= table_for(User.all) do |t| %> | |
| # <% t.column :username %> | |
| # <% t.column :email do |user| %> | |
| # <%= mail_to user.email %> | |
| # <% end %> | |
| # <% t.actions :show, :edit %> | |
| # <% end %> | |
| # |
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
| public static List<String> getFiles() { | |
| String fixturesRoot = Resources.getResource("fixtures").getPath(); | |
| final Path fixturesRootPath = Paths.get(fixturesRoot); | |
| try { | |
| return Files.walk(fixturesRootPath) | |
| .filter(Files::isRegularFile) | |
| .map(path -> fixturesRootPath.relativize(path).toString()) | |
| .collect(Collectors.toList()); | |
| } catch (IOException e) { |
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 io.sspinc.validator.example; | |
| import io.sspinc.validator.Schema; | |
| import io.sspinc.validator.ValidationErrors; | |
| import static io.sspinc.validator.Validators.allowNull; | |
| import static io.sspinc.validator.Validators.inclusion; | |
| import static io.sspinc.validator.Validators.length; | |
| import static io.sspinc.validator.Validators.presence; |
NewerOlder