Skip to content

Instantly share code, notes, and snippets.

View kubectl-context-aliases.sh
alias kgc="kubectl config get-contexts"
alias kcc="kubectl config current-context"
alias ksc="kubectl config use-context "
View towerofhanoi.py
rods = {
'A' : [],
'B' : [],
'C' : []
};
def towerOfHanoiRender():
print('########################')
max_height = sum([len(rods[i]) for i in rods]) + 2
for i in range(max_height):
View json_extract.php
<?php
$someJSON = '[{"page":1,"threads":[{"no":798995374,"last_modified":1557079802},{"no":798996364,"last_modified":1557079803},{"no":798998948,"last_modified":1557079802},{"no":798999650,"last_modified":1557079800},{"no":799002571,"last_modified":1557079800},{"no":799003186,"last_modified":1557079799},{"no":798992061,"last_modified":1557079797},{"no":799004503,"last_modified":1557079796},{"no":798994089,"last_modified":1557079794},{"no":798999145,"last_modified":1557079791},{"no":799002153,"last_modified":1557079791},{"no":799003701,"last_modified":1557079791},{"no":799004281,"last_modified":1557079787},{"no":798977911,"last_modified":1557079786},{"no":799003187,"last_modified":1557079785}]},{"page":2,"threads":[{"no":798986141,"last_modified":1557079782},{"no":799004629,"last_modified":1557079779},{"no":799000920,"last_modified":1557079779},{"no":799005197,"last_modified":1557079779},{"no":799001965,"last_modified":1557079779},{"no":799005010,"last_modified":1557079775},{"no":799002934,"last_modified":1557
View contar_chars.cpp
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
//inicializacao
char chars[100];
int contador[255];
printf("Digite uma string de 100 caracteres\n");
View dados.json
{
"data": {
"order_id": 1130509,
"pedido_venda": "Z797164",
"cliente": {
"nome": "DANILO SANTANA",
"endereco": "R Aricanga, 345, -Jardim Silva Teles",
"cep": "08160000"
},
"transportadora": {