Skip to content

Instantly share code, notes, and snippets.

View souenzzo's full-sized avatar
🚴‍♂️
💨 💨

Enzzo souenzzo

🚴‍♂️
💨 💨
View GitHub Profile
@souenzzo
souenzzo / gif.py
Created October 23, 2016 12:34
Desenhando gifs em python
#!/usr/bin/env python
"""
Antes de executar esse programa você deve instalar as dependencias:
[user@pc]~ $ pip install --user moviepy gizeh
Então execute
[user@pc]~ $ python gif.py
Irá gerar dois gifs: "a.git", "b.gif".
"""
import http.server
def bar(props):
return ["bar", {}, str(props)]
x = ["div", {},
["sp", {"onClick": "foobar()"}, ["code", {}, "foo"]],
[bar, 44, 666, 77],
["p", {}, "Olá mundo!"]]
@souenzzo
souenzzo / vetor.f
Last active October 16, 2017 00:53
!! https://gcc.gnu.org/onlinedocs/gcc-4.4.4/gfortran/ALL.html#ALL
program hello
implicit none
integer i, j, A(3), B(3)
do i = 1, 3
A(i) = i + 5
B(i) = i * 5
end do
#!/usr/bin/env python3
from functools import reduce
def append_to_graph(graph, elms):
if len(elms) == 0:
return graph
el, *ms = elms
if type(el) is str:
return append_to_graph({**graph, **{el: set()}}, ms)
e, l = el
@souenzzo
souenzzo / hanoi.cljs
Last active January 3, 2018 02:15
simple hanoi tower game. Available at https://souenzzo.github.io/hanoi.html
(ns hanoi.core
(:require [reagent.core :as reagent :refer [atom]]))
(def init
{:tabuleiro {0 [4 3 2 1]
1 []
2 []}})
(defn atualizar-tabuleiro
[st from to]
@souenzzo
souenzzo / homoiconic-js.clj
Last active January 13, 2018 11:07
Trying to represent js code as EDN.
(defn parse-args
[args]
(string/join ", " (for [arg args]
(cond
(map? arg) (let [{:keys [keys]} arg]
(format "{ %s }" (parse-args keys)))
:else arg))))
(defn emit
[x]
(ns neural.network
(:require [clojure.core.matrix :as matrix]
[clojure.core.matrix.operators :as op])
(:import (java.util Random)))
(def sigmoid matrix/logistic)
(defn sigmoid'
[x]
(op/* x (op/- 1 x)))
module.exports = {
"env": {
"es6": true,
"jest": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
#!/usr/bin/env node
var atom = {val: 0}
timeout = 1
const f = () => {
let state = atom.val
let dummmy = 0
for (let i = 0; i < 10000; i++) {
#include "I2Cdev.h"
#include <servo.h>
#include <spi.h>
#include "RF24.h"
#include "MPU6050_6Axis_MotionApps20.h"
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include "Wire.h"
#endif
#include "printf.h"
Servo motor1;