Skip to content

Instantly share code, notes, and snippets.

View nyaray's full-sized avatar
💭
Keeping it real, like floats and doubles

Emilio Nyaray nyaray

💭
Keeping it real, like floats and doubles
View GitHub Profile
@nyaray
nyaray / kernelconfdiff.exs
Created November 24, 2018 09:32
linux kernel config option comparison script
#!/usr/bin/env elixir
[a, b | opts] = System.argv()
#IO.puts ["a ", a]
#IO.puts ["b ", b]
# gather all non-comment, y or m modules from set a and set b
# print b except a

Adding bluez to Nerves

This might get tricky...

Quote notes

It's a start, basically you need to get to the point where btuart can run, that means the rpi firmware can be loaded and hciconfig and other tools can be run

Patches

From b4f2b77472aeb967d3a7595e8a965785c7a37c87 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 16 Feb 2016 16:40:46 +0000
Subject: [PATCH 1/4] bcm43xx: Add bcm43xx-3wire variant
---
tools/hciattach.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/hciattach.c b/tools/hciattach.c
@nyaray
nyaray / .gitignore
Last active July 8, 2018 08:33
a small tcp relayer that you can connect to with netcat for quick group chats, file distribution etc
*.beam
@nyaray
nyaray / some_test.exs
Created June 17, 2018 08:42
ExUnitProperties - HALP plz
# ** (ArgumentError) expected a generator, which can be a %StreamData{} struct, an atom, or a tuple with generators in it, but got: "Ti"
# code: check all sheet <- generate_timesheet() do
use ExUnit.case, async: true
use ExUnitProperties
defp generate_timesheet() do
StreamData.one_of(["Må", "Ti", "On"])
|> StreamData.uniq_list_of(min_length: 1)
end
Computer Information:
Manufacturer: Apple
Model: MacBookPro10,1
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
CPU Family: 0x6
@nyaray
nyaray / end-old.gcode
Last active January 11, 2021 19:10
Backup of start/end gcode in case (the beta version of) Cura loses it again. Wanhao duplicator i3 Plus
; M104 S0 ;extruder heater off
; G91 ;relative positioning
; G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
; G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more
; G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
; M84 ;steppers off
; G90 ;absolute positioning
@nyaray
nyaray / gist:a615b484d83281ff7813229eeaf31a66
Created July 15, 2017 09:36
Steam System Information
Computer Information:
Manufacturer: Apple
Model: MacBookPro10,1
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
CPU Family: 0x6
# assuming io lists
def name_for_type("0", client), do: birth_names client
def name_for_type("1", client), do: partner_names client
def name_for_type("2", client), do: name_for_2 client
def name_for_type("3", client), do: name_for_3 client
def name_for_type(_, client), do: birth_names client
defp birth_names(client), do: [client.birth_name_prefix, client.birth_name]
defp partner_names(client), do: [client.partner_name_prefix, client.partner_name]
@nyaray
nyaray / gist:139da2ebd6f01d6b7f73375210b08c2f
Created March 22, 2017 12:38
Phoenix error 2017-03-33
== Compilation error on file lib/mix/phoenix/context.ex ==
warning: redefining module Mix.Phoenix.Schema (current version loaded from /Users/emilio.nyaray/.mix/archives/phoenix-1.3.0-rc.1/phoenix-1.3.0-rc.1/ebin/Elixir.Mix.Phoenix.Schema.beam)
lib/mix/phoenix/schema.ex:1
** (KeyError) key :pre_existing? not found in: %Mix.Phoenix.Context{alias: {:alias, [line: 35], nil}, base_module: {:base, [line: 36], nil}, basename: {:basename, [line: 38], nil}, dir: {:dir, [line: 40], nil}, file: {:file, [line: 39], nil}, generate?: true, module: {:module, [line: 33], nil}, name: {:context_name, [line: 32], nil}, opts: {:opts, [line: 41], nil}, schema: {:schema, [line: 34], nil}, test_file: nil, web_module: {:web_module, [line: 37], [{:base, [line: 37], nil}]}}
(stdlib) :maps.update(:pre_existing?, {{:., [line: 42], [File, :exists?]}, [line: 42], [{:file, [line: 42], nil}]}, %Mix.Phoenix.Context{alias: {:alias, [line: 35], nil}, base_module: {:base, [line: 36], nil}, basename: {:basename, [line: 38], nil}, dir: {:d