Skip to content

Instantly share code, notes, and snippets.

View tiagodalloca's full-sized avatar
🤖

Tiago Dall'Oca tiagodalloca

🤖
View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
(use 'penumbra.opengl)
(require '(penumbra [app :as app]))
(def max-iterations 100)
(def num-paths 50)
(defn ikeda [x y u]
(iterate
(fn [[x_n y_n]]
(let [t_n (- 0.4 (/ 6 (+ 1 (* x_n x_n) (* y_n y_n))))]
section .text
global _start
_start:
; mov edx, msg_len
; mov ecx, msg
; mov ebx, 1
; mov eax, 4
; int 0x80
; mov eax,3 ;instrucao para ler
@tiagodalloca
tiagodalloca / led.py
Created October 3, 2017 14:07
Traz o led que pisca
import RPi.GPIO as gpio
import time
gpio.setmode(gpio.BCM)
gpio.setup(17, gpio.OUT)
gpio.setup(18, gpio.OUT)
gpio.setup(22, gpio.OUT)
gpio.setup(23, gpio.OUT)
gpio.setup(24, gpio.OUT)
@gfredericks
gfredericks / defn+spec.clj
Created June 9, 2016 19:02
A defn-like macro powered by clojure.spec
(ns user.defn+spec
(:require [clojure.spec :as s]))
(defn non-&-sym? [x] (and (symbol? x) (not= '& x)))
(s/def ::arglist
(s/cat :normal-args (s/* (s/cat :name non-&-sym?
:spec-form (s/? (s/cat :- #{:-}
:spec ::s/any))))
:varargs (s/? (s/cat :& #{'&}
@bhb
bhb / filter_spec.clj
Last active November 1, 2017 07:16
Adding your own spec for filter
(require '[clojure.spec.test.alpha :as st])
(require '[clojure.spec.alpha :as s])
(require '[expound.alpha :as expound])
(set! s/*explain-out* expound/printer)
(st/instrument)
(filter 123 "12333333333333") ; java.lang.Long cannot be cast to clojure.lang.IFn
(s/fdef clojure.core/filter
@ghoseb
ghoseb / clj_spec_playground.clj
Last active March 30, 2019 22:35
Examples of Clojure's new clojure.spec library
(ns clj-spec-playground
(:require [clojure.string :as str]
[clojure.spec :as s]
[clojure.test.check.generators :as gen]))
;;; examples of clojure.spec being used like a gradual/dependently typed system.
(defn make-user
"Create a map of inputs after splitting name."
([name email]
@fadelakin
fadelakin / average.clj
Created October 19, 2013 17:09
A function that calculates the average of some numbers in Clojure
(defn average
[numbers]
(/ (apply + numbers) (count numbers)))

State of Clojure Survey 2018 - Open comment question

This is a selection of the most articulated critique found in the open comments section Q25 at the bottom of the survey. Recurring themes are:

  1. Elitism, ivory tower, "not smart enough to get it" attitude of frequent speaker or early adopters.
  2. Poor basic documentation, error messages, beginner friendly resources.
  3. Fear of contribution (with reasons like a. community-built tools open to attack and replacement by core team b. hostile contribution environment c. closed development process)
  • The community has to grow to create more opportunities. Many organizations don't want to even consider using it because they fear not being able to find Clojure developers. Unless you have a mentor or are extremely motivated, Clojure scares away most imperative developers. My suggestions is to team up with a university and get a Clojure course on Coursera or a similar platform. This is the only way I got in