Skip to content

Instantly share code, notes, and snippets.

View janxious's full-sized avatar
🌰
.

Joel "The Gregarious" Meador janxious

🌰
.
View GitHub Profile

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.

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..}}
"""
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
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
@olih
olih / jq-cheetsheet.md
Last active May 9, 2024 19:35
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

@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.
@BinaryMuse
BinaryMuse / README.md
Last active April 20, 2022 21:45
Elixir Map/HashDict Performance on Erlang OTP R17 vs R18
@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)
@cpatterson
cpatterson / gist:0f226f35efe0afd35c9e
Last active August 29, 2015 14:14
Moved this code to the GitHub repository at: https://github.com/egineering-llc/InstrumentalKit.
We couldn’t find that file to show.
@jgautsch
jgautsch / mirth_setup.md
Last active July 28, 2023 12:39
Setting up Mirth Connect for production

Mirth Server Setup

First create ec2 Ubuntu instance

Then install all the things needed for Mirth Connect (following this video: http://www.youtube.com/watch?v=omZyAO2naqs)

# Update Ubuntu
sudo aptitude update

# Safe upgrade of Ubuntu
sudo aptitude safe-upgrade
@jboner
jboner / latency.txt
Last active May 11, 2024 04:16
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD