This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "WED_Sign_Parser.h" | |
using namespace std; | |
int main(int argc, const char * argv[]) | |
{ | |
if(argc >= 2) | |
{ | |
string sign_text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $(/usr/bin/id -u) -ne 0 ]]; then | |
echo "This script must be run with sudo" | |
exit | |
fi | |
if [ $# -lt 2 ]; then | |
echo 1>&2 "Usage: \$ ./$0 name_of_repo_to_create group_to_own_it" | |
exit 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ExplicitlyIgnoreReturnValues do | |
@moduledoc """ | |
This is a horrifying hack. | |
It is a complete copy & paste of Credo's stock unused_operation and unused_function_return_helper, | |
but modified slightly to reverse the logic; instead of specifying modules and types to warn about when unused, | |
we specify an "allow list" of the *only* modules & functions to allow ignoring. | |
See original copypasta source here: | |
https://github.com/rrrene/credo/blob/master/lib/credo/check/warning/unused_operation.ex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MmoServer.WorldCache do | |
@moduledoc "A cache of all aircraft in the world, intermittently updated for 'flight tracker' API usage" | |
use GenServer | |
require Logger | |
import Appsignal, only: [set_gauge: 2] | |
def start_link(_), do: GenServer.start_link(__MODULE__, %{}, name: __MODULE__) | |
# Log a new connected user | |
def put(%{session_id: sid, lon: lon, lat: lat} = acf) when is_integer(sid) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if git checkout "$1" ; then | |
echo "No untracked files had to be deleted" | |
else | |
git checkout "$1" 2>&1 > /dev/null | grep $'\t' | xargs rm | |
git checkout "$1" | |
echo "Deleted conflicting untracked files" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Dictionary { | |
func mapKeys<NewKey>(_ transform: (Key) -> NewKey) -> [NewKey: Value] { | |
reduce(into: [NewKey: Value]()) { result, item in | |
result[transform(item.key)] = item.value | |
} | |
} | |
} | |
/// 🥤 | |
extension Dictionary where Key: RawRepresentable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_user = User.start_link("Tyler", "abcd-efgh-1234-5678") | |
# Prints "Hi, I'm Tyler" | |
User.say_hello(my_user) | |
# Prints a process ID | |
IO.inspect(my_user) | |
# Prints the state data: | |
# %{name: "Tyler", id: "abcd-efgh-1234-5678"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Greeter do | |
use GenServer | |
def start_link(opts) do | |
name = Access.get(opts, :name, __MODULE__) | |
GenServer.start_link(__MODULE__, name, name: name) | |
end | |
def greet(server \\ __MODULE__, name) do | |
GenServer.call(server, {:greet, name}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you're here, I assume it's because you tried to run | |
# :observer for the first time on your Mac and discovered | |
# it won't work because of some obscure issue with wxwidgets | |
# (formerly known to Homebrew as wxmac). | |
# | |
# This script will fix it for you. | |
# 1. Remove the old and busted copy | |
brew uninstall wxwidgets --ignore-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test Elixir Server | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main |
OlderNewer