This file contains 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 { DatabaseCluster, CfnGlobalCluster, DatabaseClusterProps, CfnDBCluster } from 'aws-cdk-lib/aws-rds' | |
import { Construct } from 'constructs' | |
export class GlobalDatabaseCluster extends DatabaseCluster { | |
public readonly globalCluster: CfnGlobalCluster | |
constructor(scope: Construct, id: string, props: DatabaseClusterProps) { | |
super(scope, id, props) | |
this.globalCluster = new CfnGlobalCluster(this, 'global-cluster', { |
This file contains 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
brew tap homebrew/versions | |
brew install v8-315 | |
gem install libv8 -v '3.16.14.13' -- --with-system-v8 | |
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315 | |
bundle install |
This file contains 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 urllib.request | |
import json | |
url = 'http://educacao.dadosabertosbr.com/api/escolas/buscaavancada?situacaoFuncionamento=1&energiaInexistente=on&aguaInexistente=on&esgotoInexistente=on' | |
resp = urllib.request.urlopen(url).read() | |
resp = json.loads(resp.decode('utf-8')) | |
print ('Número de Escolas em funcionamento sem energia, água e esgoto:', resp[0]) | |
for x in resp[1]: | |
print (x['nome'], x['cod']) | |
print (x['cidade'], x['estado'], x['regiao']) | |
print () |
This file contains 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 urllib.request | |
import json | |
url = 'http://educacao.dadosabertosbr.com/api/escolas?nome=' | |
escola = 'embraer' | |
resp = urllib.request.urlopen(url+escola).read() | |
resp = json.loads(resp.decode('utf-8')) | |
for x in resp[1]: | |
print (x['nome']) | |
print ('Código:', x['cod']) | |
print (x['cidade'], x['estado']) |
This file contains 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 python | |
# Standard library imports. | |
from SocketServer import ThreadingMixIn | |
import BaseHTTPServer | |
import SimpleHTTPServer | |
import sys | |
import json | |
import os | |
from os.path import (join, exists, dirname, abspath, isabs, sep, walk, splitext, |
This file contains 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
// REPL example bot for mineflayer | |
// | |
// Connects to server but doesn't have any built in logic. The terminal where | |
// it was started is now a REPL (Read-Eval-Print-Loop). Anything typed will be | |
// interpreted as javascript printed using util.inspect. Don't forget to try | |
// tab completion. These variables are exposed as local: | |
// | |
// var mineflayer = require('mineflayer'); | |
// var bot = mineflayer.createBot({ username: 'REPL' }); | |
// |
This file contains 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
""" | |
A really stupid python template language inspired by coffeekup, markaby. | |
Do not use this code, it will ruin your day. A byproduct of insomnia. | |
TL;DR | |
----- | |
This module defines a template language that allows us to do: | |
d = Doc() |