Skip to content

Instantly share code, notes, and snippets.

View luanpotter's full-sized avatar
:octocat:
Coding...

Luan Nico luanpotter

:octocat:
Coding...
View GitHub Profile
@luanpotter
luanpotter / star.dart
Created June 19, 2022 14:29
A Star is Born
import 'dart:math';
import 'dart:ui';
import 'package:flame/game.dart';
import 'package:flame/input.dart';
import 'package:flame/palette.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flutter/material.dart' hide Gradient;
final _r = Random();
85010c0306aac33cc7344ee70107ff74ecbf7a197820e9ed1d8fc5b011c4
ca76777083ac5e80c59415371f0b66b6f6427d8ec0d2b3ee31f8d33a6d3a
1fe7791f08d44ed474126a3e6e781fc8f564f568d5d04e826261db3c3f26
8b2a0ea2d7d7cfbadb5cc345a6f437266b34d229beb1d146b1b1add5e165
e3b820b41d3d5710718bf6e60948c69de460a190b21a8bfab797013c9d0b
ff6ba22a1ff21209e4ae8c207128bcc99bf027684d6578ee66da8c5482c8
22626875e31fa3d6d873e0f80f4d0f88dbecaa8d3dd7aad4c4a81246e458
9fb3ec6959743d27316d8bfafc5b9fa3c58a5aa1d05341f9f2090145dddb
dff2431bde6058eff6d80f7ba2e87aae74a3856b7f55d9fef70ada7376ad
35d26301cce0a88921062dc0d6c9110e64d12902667149a097f491c6bb16
const bools = ['sim', 'não'];
const fx = (num) => {
const r=Math.sqrt(num);
for(let i=0; i<=r; i++)
if(num % i === 0) return false;
return num>1;
};
@luanpotter
luanpotter / SimpleTest.java
Created June 6, 2018 20:14
a simple test using xmlbeam that fails
import org.junit.Test;
import static com.google.common.truth.Truth.assertThat;
import org.w3c.dom.Node;
import org.xmlbeam.XBProjector;
import org.xmlbeam.types.XBAutoMap;
public class SimpleTest {

Keybase proof

I hereby claim:

  • I am luanpotter on github.
  • I am luan (https://keybase.io/luan) on keybase.
  • I have a public key ASBXke-DO-PJjCl5pMZ0zPTmJk3Sn-CI4zhVCYnlRGPwpQo

To claim this, I am signing this object:

@luanpotter
luanpotter / jquery.table.sorter.js
Last active August 16, 2016 15:32
jquery make any table sortable
$('th').addClass('order'); //hack
$('table').each(function () {
var table = $(this);
var sortOrder = [];
var cmp = function (order, e1, e2) {
return order * e1.localeCompare(e2);
};
Graphs
===================
Definition
---
A graph is a mathematical structure that represents a set of objects where some pairs of objects are connected by links. The interconnected objects are represented by mathematical abstractions called vertices (also called nodes or points), and the links that connect some pairs of vertices are called edges (also called arcs or lines or edges). Edges might have direction or not, depending on the kind of Graph, and more generally can have a cost associated with then, or a real number representing something of the structure being modeled.
Representation
---
var copyId = DriveApp.getFileById(docTemplate).makeCopy("Carta for " + nome).getId();
// Open the temporary document
var copyDoc = DocumentApp.openById(copyId);
// Get the document’s body section
var copyBody = copyDoc.getActiveSection();
// Replace place holder keys,in our google doc template
copyBody.replaceText('{nome}', nome);
copyBody.replaceText('{rg}', rg);
copyBody.replaceText('{cpf}', cpf);