Skip to content

Instantly share code, notes, and snippets.

View janxious's full-sized avatar
🌰
.

Joel "The Gregarious" Meador janxious

🌰
.
View GitHub Profile
We couldn’t find that file to show.
@sunaku
sunaku / fizzbuzz.exs
Last active July 14, 2020 18:10
A functional FizzBuzz (without any integer modulus or division) in Elixir. See https://pragprog.com/magazines/2012-08/thinking-functionally-with-haskell
# A functional FizzBuzz (without any integer modulus or division) in Elixir
# https://pragprog.com/magazines/2012-08/thinking-functionally-with-haskell
nums = Stream.iterate(1, &(&1 + 1))
fizz = Stream.cycle ["", "", "Fizz"]
buzz = Stream.cycle ["", "", "", "", "Buzz"]
fizzbuzz = Stream.zip(fizz, buzz) |> Stream.zip(nums) |> Stream.map(fn
{{"", "" }, number} -> number
{{fizzword, buzzword}, _number} -> fizzword <> buzzword
end)
fizzbuzz |> Stream.take(100) |> Enum.each(&IO.puts/1)
@BinaryMuse
BinaryMuse / README.md
Last active April 20, 2022 21:45
Elixir Map/HashDict Performance on Erlang OTP R17 vs R18
@jfcloutier
jfcloutier / fault_tolerant_event_manager.ex
Last active December 4, 2020 05:41
Fault-tolerant event managers in Elixir
# By default, GenEvent event handlers fail silently and are not automatically restarted. Not good.
# There's an easy enough way to correct this.
# You'll need to
# 1. define a supervised event manager as a GenServer,
# 2. register its GenEvent handlers with monitoring enabled
# 3. catch handler exits as "out of band" messages (handle_info)
# 4. stop the event manager when any handler crashes, relying on the supervisor to restart the event
# manager who will then restart all of its GenEvent handlers.
# This approach assumes that event handling is either stateless or can reset its state without issues.
@olih
olih / jq-cheetsheet.md
Last active May 6, 2025 16:08
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@IanColdwater
IanColdwater / twittermute.txt
Last active April 14, 2025 16:31
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
defmodule GenysysWeb.SectionTemplateArrayHelpers do
use Phoenix.HTML
"""
Use like (In template):
<%= map_array_input f, :features, ["title", "body", "color", "icon"] %>
<%= map_array_add_button f, :features, ["title", "body", "color", "icon"] %>
Result %{"0" => %{args..}}
"""

How to install game-porting-toolkit (aka proton for macOS)

You also might wanna just use Whisky which does this automatically

This guide works on macOS 13.4+ using Command Line Tools for XCode 15 Beta!

What is this?

In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.