This Gist includes some of the common AWS/IAM policy examples to give granular access to users.
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
| You are a coding agent running in the Codex CLI, a terminal-based coding assistant. Codex CLI is an open source project led by OpenAI. You are expected to be precise, safe, and helpful. | |
| Your capabilities: | |
| - Receive user prompts and other context provided by the harness, such as files in the workspace. | |
| - Communicate with the user by streaming thinking & responses, and by making & updating plans. | |
| - Emit function calls to run terminal commands and apply patches. Depending on how this specific run is configured, you can request that these function calls be escalated to the user for approval before running. More on this in the \"Sandbox and approvals\" section. | |
| Within this context, Codex refers to the open-source agentic coding interface (not the old Codex language model built by OpenAI). | |
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 getCsrfToken() { | |
| var parts = ('; ' + document.cookie) | |
| .split("; csrf="); | |
| if (parts.length === 2) { | |
| const value = parts.pop().split(";").shift(); | |
| return decodeURIComponent(value); | |
| } | |
| } | |
| function sendXhr(url, method, data = null, headers = {}) { |
First get Docker installed and setup on machine. Once installed, create a new user e.g., metabase for your installation using following command:
sudo adduser metabaseNow add the newly created user to docker group, you won't need sudo for docker ... commands:
sudo usermod -aG docker metabase
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 | |
| CERTIFICATES=`openssl s_client -servername $1 -host $1 -port 443 -showcerts </dev/null 2>/dev/null | sed -n '/Certificate chain/,/Server certificate/p'` | |
| CURSOR=$CERTIFICATES | |
| while [[ "$CURSOR" =~ '-----BEGIN CERTIFICATE-----' ]] | |
| do | |
| CERTIFICATE="${CURSOR%%-----END CERTIFICATE-----*}-----END CERTIFICATE-----" | |
| CURSOR=${CURSOR#*-----END CERTIFICATE-----} | |
| echo `echo "$CERTIFICATE" | grep 's:' | sed 's/.*s:\(.*\)/\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
| import androidx.lifecycle.LiveData | |
| import androidx.lifecycle.MediatorLiveData | |
| import kotlinx.coroutines.CoroutineScope | |
| import kotlinx.coroutines.Job | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.launch | |
| fun <T> LiveData<T>.debounce(duration: Long = 1000L, coroutineScope: CoroutineScope) = MediatorLiveData<T>().also { mld -> | |
| val source = this |
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 resize($el) { | |
| const data = $el.data('center'); | |
| if (data.x) { | |
| const w_width = $(window).width(); | |
| const e_width = $el.width(); | |
| const margin = (w_width - e_width) / 2; | |
| $el.css('left', margin) | |
| } | |
| if (data.y) { | |
| const w_height = $(window).height(); |
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
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| const handleLogout = () => { | |
| axios.post('/logout') | |
| .then(() => location.href = '/home') | |
| }; | |
| function Example() { | |
| return ( |
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
| const e = str => { | |
| const replacements = { | |
| '&': '&', | |
| '<': '<', | |
| '>': '>', | |
| "'": ''', | |
| '"': '"', | |
| }; | |
| return str.replace(/[&<>"']/g, match => replacements[match]) | |
| }; |
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
| <?php | |
| namespace App\Twig; | |
| use Symfony\Component\HttpFoundation\RequestStack; | |
| use Twig\Extension\AbstractExtension; | |
| use Twig\TwigFunction; | |
| class ActiveExtension extends AbstractExtension | |
| { |
NewerOlder