Skip to content

Instantly share code, notes, and snippets.

View PJUllrich's full-sized avatar

Peter Ullrich PJUllrich

View GitHub Profile
from observer.observer_pattern import Observable, Observer
class Elf:
name = 'Galadriel'
def nall_nin(self):
print('Elf says: Calling the Overlord ...')
@PJUllrich
PJUllrich / demo
Last active June 19, 2018 19:58
Solidity Call, Callcode, Delegatecall Demo. Deploy contracts. Call functions and see how sender changes in either B, or C.
pragma solidity ^0.4.24;
contract A {
address public sender;
function dcall(B other, C child) public {
other.dcall(child);
}
}
defmodule Support.FeatureCase do
@moduledoc false
use ExUnit.CaseTemplate
using do
quote do
@moduletag :feature
use Wallaby.DSL
name: Update data
on:
schedule:
- cron: "0 5 * * *"
jobs:
execute:
runs-on: ubuntu-latest
require 'google/apis/identitytoolkit_v3'
require 'google/apis/core/api_command'
require 'googleauth'
require 'addressable/template'
require 'json'
require 'securerandom'
# Request to delete account.
class CreateSessionCookieRequest
include Google::Apis::Core::Hashable
name: Elixir CI
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
@PJUllrich
PJUllrich / regularly_check_appointments_in_cologne.exs
Last active June 7, 2021 12:26
Checks for available appointments in the "Bürgeramt" in Cologne and notifies via Pushover
defmodule Terminvergabe do
@moduledoc """
This script checks for available appointments in the "Bürgeramt" (city hall)
every 5min and notifies a user via Pushover if new appointments become were added.
In order to use Pushover, you must configure the following environment variables:
PUSHOVER_USER
PUSHOVER_TOKEN
@PJUllrich
PJUllrich / pubsub.ex
Last active December 23, 2021 19:48
PubSub Library for broadcasting results of Ecto operations
defmodule MyApp.PubSubLib do
@moduledoc """
This library implements easy to use Publish-Subscribe functionality.
## Usage
Use this library with `use MyApp.PubSubLib`.
## Example
defmodule MyApp.MyPublishingModule do
@PJUllrich
PJUllrich / example.exs
Created October 22, 2022 11:00
Example Error when using tsvector with regconfig in Ecto
## Migration
def up do
create table(:books) do
add :title, :string
add :summary, :text
add :language, :text
end
for lang <- ['english', 'spanish', 'italian'] do
execute """
@PJUllrich
PJUllrich / tasks.json
Created December 20, 2021 13:20
VSCode Tasks for running Elixir tests quickly
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "mix compile",
"problemMatcher": ["$mixCompileError", "$mixCompileWarning"],
"group": {
"kind": "build",