Skip to content

Instantly share code, notes, and snippets.

View sescobb27's full-sized avatar
🇨🇴
sisas parce

Simon Escobar Benitez sescobb27

🇨🇴
sisas parce
View GitHub Profile
@benjamincharity
benjamincharity / autonomous.txt
Last active April 30, 2024 11:59
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
@JoshCheek
JoshCheek / 3d_cubes.rb
Last active June 24, 2017 00:55
3d Cubes
# Video is @ https://vimeo.com/222905527
# The math is prob wrong, but it's close enough to actually render them in 3D.
# It's just me trying to think through what should make sense based on how
# people describe things, and then trying to work out what the correct math
# is to pull it off, but obv I'm not quite there.
require 'graphics'
require 'matrix'
def √ n
@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

@bsuh
bsuh / page_controller.ex
Last active July 16, 2020 20:00
proxying responses
defmodule PhoenixTest.PageController do
use PhoenixTest.Web, :controller
def index(conn, _params) do
render conn, "index.html"
end
def proxy(conn, params) do
query_string = conn.query_string
path = Enum.join(params["path"], "/")
@mike-north
mike-north / enemy_of_the_state.md
Last active January 11, 2017 04:29
EmberFest 2016 - Enemy of the state
cowboy_req(3) Cowboy Function Reference cowboy_req(3)
NAME
cowboy_req - HTTP request and response
DESCRIPTION
The module cowboy_req provides functions to access, manipulate and
respond to requests.
There are four types of functions in this module. They can be differ‐

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@lepoetemaudit
lepoetemaudit / deepmerge.ex
Last active February 16, 2017 03:36
Deep (recursively) merge maps in elixir
defmodule DeepMerge do
defp _merge(key, v1, v2) when is_map(v1) do
Map.merge(v1, v2, &_merge/3)
end
defp _merge(key, v1, v2), do: v2
def merge(map1, map2) when is_map(map1) and is_map(map2) do
Map.merge map1, map2, &_merge/3
end
@josevalim
josevalim / watcher.sh
Last active February 28, 2024 07:42
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
fswatch lib/ test/ | mix test --stale --listen-on-stdin