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 | |
# <xbar.title>Internet check</xbar.title> | |
# <xbar.version>v1.0</xbar.version> | |
# <xbar.author>Daniel Dias</xbar.author> | |
# <xbar.author.github>danielbdias</xbar.author.github> | |
# <xbar.desc>Plugin to check network stability on your Mac.</xbar.desc> | |
# <xbar.image>http://www.hosted-somewhere/pluginimage</xbar.image> | |
# <xbar.dependencies>perl</xbar.dependencies> |
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 gymnasium as gym | |
env = gym.make("CartPole-v1") | |
observation, info = env.reset(seed=42) | |
for iteration in range(1000): | |
action = env.action_space.sample() # this is where you would insert your policy | |
observation, reward, terminated, truncated, info = env.step(action) | |
print('Current iteration: ', iteration) |
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
# Installing Tracetest and Signoz on a Kubernetes cluster | |
k3d cluster create tracetest-signoz | |
cat << EOF > opentelemetry-collector-resources.yaml | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: collector-config | |
data: |
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 | |
for code_directory in $(ls -d */) | |
do | |
# go to directory | |
cd $code_directory | |
code_directory_default_branch=$(git rev-parse --abbrev-ref origin/HEAD | sed 's@^origin/@@') | |
code_directory_current_branch=$(git rev-parse --abbrev-ref HEAD | sed 's@^origin/@@') |
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
class Endereco | |
# ... | |
end | |
class Rota | |
# ... | |
end | |
class GPS | |
def calcular_rota(endereco) |
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
class Coiso | |
# ... | |
end | |
class Rota | |
# ... | |
end | |
class GPS | |
def calcular_rota(coiso) |
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
class Coiso | |
def ligar_com(treco) | |
# ... | |
Coisa.new | |
end | |
# ... | |
end | |
class Treco | |
# ... |
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 here your main branch | |
MAIN_BRANCH=master | |
# command to list the files that you changed in your current branch and already commit to that branch | |
git --no-pager diff --name-only $MAIN_BRANCH | |
# and command to list the files that you changing right now | |
git status -s | awk '{if ($1 == "M" || $1 == "??") print $2}' | |
# execute both commands, concatenate the results and remove the duplicates |
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 { expect } = require(‘chai’) | |
const MyCustomType = require(‘./MyCustomType’) | |
describe(‘MyCustomType test’, () => { | |
it(‘checks aCustomResolvedField #resolve’, () => { | |
const testObject = { | |
myStringField: 'hello', | |
innerValues: { | |
innerField: 'world' | |
} | |
} |
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 { GraphQLString, | |
GraphQLObjectType } = require(‘graphql’ | |
) | |
const MyCustomType = new GraphQLObjectType({ | |
name: ‘MyCustomType’, | |
description: ‘My custom type’, | |
fields: () => ({ | |
myStringField: { | |
type: GraphQLString, | |
description: ‘A string field’ |
NewerOlder