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
""" | |
* Listing files in directories and subdirectories | |
* inspired by an example by Daniel Shiffman. | |
* | |
* 1) List the names of files in a directory | |
* 2) List the names along with metadata (size, lastModified) | |
* of files in a directory | |
* 3) List the names along with metadata (size, lastModified) | |
* of files in a directory and all subdirectories (using recursion) | |
""" |
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
""" | |
Autores: | |
Tiago Henrique da Cruz Pereira | |
João Felipe de Moraes Borges | |
""" | |
import threading | |
import time | |
import os | |
from urllib.request import urlopen |
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
""" | |
CircleMutualAttraction (v2.3.8) | |
by Speykious (2017-Jun-27) | |
mod GoToLoop (2017-Jun-29) | |
https://Forum.Processing.org/two/discussion/23226/ | |
new-python-example-for-the-fisica-library#Item_2 | |
https://Gist.GitHub.com/GoToLoop/1861619991354ed7d063026658270689 | |
""" |
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
/* | |
* Generates 32x32 tiles that can be connected with conduits on one or | |
* more sides. The basic process is: | |
* | |
* 1. Draw a bunch of random boxes with color X, none of which touch the outer perimeter. | |
* 2. draw some conduits from the edges -- each conduit is two color-X lines going toward | |
* the center until they hit a color-X pixel | |
* 3. flood fill from the four corners of the perimeter with color Y. | |
* 4. erase all X-color pixels that don't have an adjacent Y-color pixel in the four | |
* cardinal directions. |
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 | |
# -*- coding: utf-8 -*- | |
from gimpfu import * | |
from os import remove, name | |
from os.path import basename | |
from tempfile import NamedTemporaryFile | |
from subprocess import check_output, CalledProcessError, STDOUT | |
# Export with Google Guetzli Perceptual JPEG encoder |
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
void setup() { | |
Serial.begin(9600); // initialize serial communications @ 9600 | |
} | |
void loop() { | |
int potentiometer = analogRead(A0); // read the input pin | |
int mappedPot = map(potentiometer, 0, 1023, 0, 255); // remap the pot value to fit in 1 byte | |
//Serial.write(mappedPot); // write mappedPot value to the serial port (1 byte) | |
Serial.println(potentiometer); // *or* use println to print out raw potentiometer value with newline as data separator | |
delay(1); // slight delay to stabilize the ADC |
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
<?php | |
// mdview.php by Yorik van Havre, GPL license | |
// This script generates a nice HTML rendering of a Markdown file that is hosted and | |
// shared on an owncloud server, using strapdownjs.com. | |
// To use it, simply place this file somewhere on your web space, and call it with the | |
// following arguments: http://path/to/mdview.php?file=XXXXXXXX&theme=spacelab | |
// the XXXXXXX is the share code from the link you obtain when sharing a file in owncloud. | |
// theme is optional, and can be one of the themes described on strapdownjs.com. If not | |
// provided, the spacelab theme is used (with a bit of changes I did in the <style> tag below) |
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
class PWindow extends PApplet { | |
PWindow() { | |
super(); | |
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this); | |
} | |
void settings() { | |
size(500, 200); | |
} |
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
/* and now with 100% more branding */ | |
body { border: 10px solid #82FA32; min-height: 720px; } | |
.container { width: inherit; } | |
.header { display: none; } | |
.gh-header { padding: 30px 0px 30px 0px; background-color: black; color: white; } | |
.gh-header-actions { float: inherit; text-align: center; } | |
.btn-primary { border-color: #000; background-image: linear-gradient(#333, #000); } | |
.gh-header-actions .btn { float: inherit; } | |
.gh-header-title { padding-top: 20px; text-align: center; font-size: 4.2em; margin-right: 0px; font-weight: 100; } | |
.pagehead { display: none; } |
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 asyncio | |
import json | |
import aiohttp | |
SCHOOL_URL_FMT = 'http://educacao.dadosabertosbr.com/api/escola/{}' | |
SEARCH_SCHOOL_URL = ( | |
'http://educacao.dadosabertosbr.com/api/escolas/buscaavancada?' | |
'situacaoFuncionamento=1&energiaInexistente=on&aguaInexistente=on&' |