Skip to content

Instantly share code, notes, and snippets.

View alfredbaudisch's full-sized avatar

Alfred Reinold Baudisch alfredbaudisch

View GitHub Profile
@alfredbaudisch
alfredbaudisch / Lua.tmLanguage
Last active December 12, 2015 06:48
Sublime Text 2 Lua language file with support to stored functions. With it Go to Symbol captures all of the following scenarios: local stored; stored = function() end / local class = {}; local stored; class:stored = function() end / class.stored1 = function () end / local function loc(params) end / function glob(params) end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>Lua Syntax: version 0.8</string>
<key>fileTypes</key>
<array>
<string>lua</string>
</array>
@alfredbaudisch
alfredbaudisch / erlang-osx-32bits.txt
Last active January 7, 2016 12:07
Install Erlang for Elixir on OS X with working Observer to fix the wxe_driver.so not found error
- Download Erlang source from http://www.erlang.org/download.html
- tar zxvf otp_src_18.2.1.tar.gz
- Configure for 32 bits (wxe_driver.so won't be generated for 64-bits):
- CFLAGS=-O0 ./configure --disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll
- ./otp_build autoconf
- ./configure && make && sudo make install
- which erl
- Install Elixir
- iex
- :observer.start should finally work
@alfredbaudisch
alfredbaudisch / up-and-running-with-edeliver-on-do.md
Created December 23, 2016 18:03 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
@alfredbaudisch
alfredbaudisch / kernel.ex
Created March 15, 2021 12:29
Elixir: using global operators in pipes
# To concat to lists, you normally do:
list = [1]
list ++ [2]
# result: [1, 2]
# How do you do that in pipelines?
# Global operators are under the Kernel module, so you can use them with the pipe operator.
list |> Kernel.++([2])
@alfredbaudisch
alfredbaudisch / pipe_struct.ex
Last active March 15, 2021 12:45
Elixir: returning the value of a map or struct field using an anonymous fun with a pipe (syntax sugar)
defmodule Company do
schema "companies" do
field(:name, :string)
field(:email, :string)
end
end
from(c in Company, where: c.name == "foo")
|> Repo.one()
|> (& &1.email).()
@alfredbaudisch
alfredbaudisch / test.gd
Created July 26, 2022 12:44 — forked from winston-yallow/test.gd
Godot 4.x Compute Example
extends Node
# Based on this tweet by Clay John:
# https://twitter.com/john_clayjohn/status/1306447928932753408
func _ready() -> void:
# Create a local rendering device.
var rd := RenderingServer.create_local_rendering_device()

Single Page Oban Web

Application.put_env(:sample, Sample.Repo, database: "oban_dev")

Application.put_env(:phoenix, :json_library, Jason)

Application.put_env(:sample, Sample.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 5001],
  server: true,
@alfredbaudisch
alfredbaudisch / .gitattributes
Created September 12, 2022 15:27 — forked from Srfigie/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@alfredbaudisch
alfredbaudisch / .gitattributes
Last active September 12, 2022 15:40 — forked from nemotoo/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@alfredbaudisch
alfredbaudisch / CsUnityFileLayout.xml
Created September 13, 2022 09:04 — forked from VacuumBreather/CsUnityFileLayout.xml
Rider C# File Layout for Unity classes
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"
xmlns:unity="urn:schemas-jetbrains-com:member-reordering-patterns-unity">
<!-- StyleCop Unity Classes Layout -->
<TypePattern DisplayName="StyleCop Unity Classes Layout" RemoveRegions="All" Priority="150">
<TypePattern.Match>
<unity:SerializableClass />
</TypePattern.Match>
<Region Name="Constants and Fields">