- grab linux source tree from git@github.com:OE4T/linux-tegra-4.9.git
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/bash | |
| set -euo pipefail | |
| # | |
| # Global pre-commit hook: block Claude Code from committing on main worktrees. | |
| # Only gate Claude Code sessions. Human commits always pass through. | |
| [ -z "${CLAUDECODE:-}" ] && exit 0 | |
| # Paths where direct commits on main worktree are ALLOWED. | |
| # Everything else requires a worktree. |
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/bash | |
| # kudos to https://github.com/exp0nge | |
| # https://github.com/cli/cli/discussions/5095#discussioncomment-10898590 | |
| set -euo pipefail | |
| jwt_encode() { | |
| # https://stackoverflow.com/questions/58313106/create-rs256-jwt-in-bash | |
| PEM=$( cat "$GITHUB_APP_SECRET_PATH" ) |
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 | |
| set -o pipefail | |
| client_id=$1 # Client ID as first argument | |
| pem=$( cat $2 ) # file path of the private key as second argument | |
| now=$(date +%s) | |
| iat=$((${now} - 60)) # Issues 60 seconds in the past |
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 python3.7 | |
| import asyncio | |
| import iterm2 | |
| async def changeTheme(connection,parts): | |
| theme_dark = "Tango Dark" | |
| theme_light = "Tango Light" | |
| print(parts) | |
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
| { | |
| "telemetry.enableTelemetry": false, | |
| "terminal.integrated.fontFamily": "TerminessTTF Nerd Font, monospace", | |
| "editor.renderControlCharacters": true, | |
| "files.autoSave": "onFocusChange", | |
| "editor.fontFamily": "SpaceMono Nerd Font Mono, Menlo, monospace", | |
| "extensions.autoUpdate": false, | |
| "debug.console.fontFamily": "TerminessTTF Nerd Font, monospace", | |
| "editor.codeLensFontFamily": "TerminessTTF Nerd Font, monospace", | |
| "window.zoomLevel": 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
| payload.json: | |
| { | |
| "resource_id": "/subscription/.../...", | |
| "version": "2020-07-21", | |
| "type": "Linux", | |
| "properties": { | |
| "custom_log_files": [ | |
| "/var/log/dmesg", | |
| "/var/log/messages" |
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 | |
| REPO_PREFIX="https://download.postgresql.org/pub/repos/yum" | |
| REPO_SUFFIX="9.6/redhat/rhel-7-x86_64" | |
| wget "$REPO_PREFIX/RPM-GPG-KEY-PGDG-96" | |
| sudo rpm --import ./RPM-GPG-KEY-PGDG-96 | |
| rm -f ./RPM-GPG-KEY-PGDG-96 | |
| echo " |
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
| defmodule FunctionHead do | |
| def create(attrs) when is_map(attrs) do | |
| with {:ok, doc} <- new(attrs), | |
| {:ok, _ } <- persist(doc), | |
| do: {:ok, doc} | |
| end | |
| def persist(doc), do: ExAws.Dynamo.put_item(__MODULE__.table_name, doc) | |
| def where(filter) when is_map(filter) do | |
| with {:ok, response } <- ExAws.Dynamo.get_item(__MODULE__.table_name, filter), |
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
| doc = %{id: "Foo"} | |
| #wrong | |
| defmodule FooBar do | |
| def valid_version(doc) do | |
| if (is_integer(doc.version)), do: doc, else: doc.version = 1 | |
| end | |
| end | |
| # correct |
NewerOlder