Skip to content

Instantly share code, notes, and snippets.

Renato Athaydes renatoathaydes

Block or report user

Report or block renatoathaydes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@renatoathaydes
renatoathaydes / Dockerfile
Created Jul 6, 2019
Minimalistic Docker image from a simple Dart application - includes only the AOT-compiled app and dartaotruntime.
View Dockerfile
FROM google/dart AS dartc
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD bin/ /app/bin/
ADD lib/ /app/lib/
RUN pub get --offline
RUN dart2aot /app/bin/main.dart /app/main.aot
View main.dart
abstract class _State {
T use<T>(
T Function(_ChooseProviderState) useChooseProviderState,
T Function(_LoadingState) useLoadingState,
T Function(_ChooseAccountsState) useChooseAccountState,
T Function(_ImportingState) useImportingState) {
if (this is _ChooseProviderState) {
return useChooseProviderState(this);
}
if (this is _LoadingState) {
@renatoathaydes
renatoathaydes / index.html
Created Apr 18, 2019
CheerpJ index.html file
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CheerpJ test</title>
<script src="https://cjrtnc.leaningtech.com/1.3/loader.js"></script>
</head>
<body>
</body>
<script>
View spectral-norm.pony
use col = "collections"
use fmt = "format"
type Error is String
type Result is (F64 | Error)
type MaybeArray is (Array[F64] iso | Error val)
interface ReceiveUV
be receive(m: MaybeArray, a: Array[F64] iso)
@renatoathaydes
renatoathaydes / index.html
Last active Feb 9, 2019
Tic Tac Toe Game written in Dart. This is a clone of the game written in the React official tutorial: https://reactjs.org/tutorial/tutorial.html
View index.html
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>
@renatoathaydes
renatoathaydes / create_github_pages_branch.sh
Created Oct 29, 2018
Use git worktree to maintain GitHub Pages branch
View create_github_pages_branch.sh
# Initialize a gh-pages branch... GitHub expects this branch to exist to publish a project website from it.
git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Initializing gh-pages branch"
git push origin gh-pages
git checkout master
# Define a directory where the static website files will reside
WEBSITE_DIR=target
@renatoathaydes
renatoathaydes / ClassicPostExecutionExample.java
Created Jan 14, 2018
HTTPComponents HTTPClient evolution
View ClassicPostExecutionExample.java
/*
* HTTPClient usage circa version 5.0-beta.
*/
package org.apache.hc.core5.http.examples;
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.TimeUnit;
@renatoathaydes
renatoathaydes / keybase.md
Created Sep 27, 2017
Keybase - Renato Athaydes
View keybase.md

Keybase proof

I hereby claim:

  • I am renatoathaydes on github.
  • I am renatoathaydes (https://keybase.io/renatoathaydes) on keybase.
  • I have a public key ASD6izZl-Pe5lHzlFdjcZS6HjOG_pPWAkvLfZvAEo2Q9xwo

To claim this, I am signing this object:

@renatoathaydes
renatoathaydes / client.groovy
Last active Nov 17, 2018
HTTP Server / Client in Groovy
View client.groovy
/*
* This is a runnable groovy script.
* Run with "groovy client.groovy".
*
* Don't forget to start the server.groovy script first (shown in this gist).
*/
import groovy.transform.CompileStatic
import groovy.transform.Immutable
import groovy.transform.ToString
@renatoathaydes
renatoathaydes / fixIntellijProject.groovy
Created Jun 16, 2016
Adds src/test/groovy as test sources to all projects under the current directory
View fixIntellijProject.groovy
import groovy.io.FileType
import groovy.util.slurpersupport.GPathResult
import groovy.xml.XmlUtil
def intellijFileVisitor = { File intellijFile ->
def groovyDir = new File(intellijFile.parentFile, 'src/test/groovy')
if (groovyDir.isDirectory() && groovyDir.list()?.size() > 0) {
def module = new XmlSlurper().parse(intellijFile)
GPathResult sources = module.component.content.sourceFolder
def groovySources = sources.any { it.@url == 'file://$MODULE_DIR$/src/test/groovy' }
You can’t perform that action at this time.