I hereby claim:
- I am mfressdorf on github.
- I am mfressdorf (https://keybase.io/mfressdorf) on keybase.
- I have a public key ASCS8qpFmO3_jtzKKSX2F6Z-2-ouPO49nGw0oJFvLeOe5Ao
To claim this, I am signing this object:
| const std = @import("std"); | |
| const String = []const u8; | |
| const ListenersList = std.ArrayList(*const fn(String) void); | |
| pub const EventEmitter = struct { | |
| allocator: *std.mem.Allocator, | |
| listeners: std.StringHashMap(*ListenersList), | |
| pub fn init(allocator: *std.mem.Allocator) EventEmitter { | |
| return EventEmitter{ |
| function fetchFileDimensionsAsBlob(file: File) { | |
| const src = URL.createObjectURL(file); | |
| const image = new Image(); | |
| image.onload = function() { | |
| resolve({ | |
| src, | |
| dimensions: { | |
| width: image.width, | |
| height: image.height, | |
| }, |
| function filterByConditions(arr: any[], ...filterFunctionConditions: Function[]): any[][] { | |
| const results = [[]]; | |
| filterFunctionConditions.forEach(() => results.push([])); | |
| for (const value of arr) { | |
| let conditionMet = false; | |
| for (let i = 0; i < filterFunctionConditions.length; i++) { | |
| if (filterFunctionConditions[i](value)) { | |
| results[i].push(value); | |
| conditionMet = true; | |
| break; |
| function divideBy(arr: any[], divideFn: Function) { | |
| return arr.reduce((agg, curr) => divideFn(curr) ? | |
| [[...agg[0], curr], agg[1]] : | |
| [agg[0], [...agg[1], curr]], | |
| [[], []]); | |
| } | |
| const fruits = ['apple', 'orange', 'banana']; | |
| const divideFn = (fruit) => fruit === 'apple'; |
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * Install and enable the rabbitmq_delayed_message_exchange plugin as described by Alvaro Videla in this blogpost: | |
| * https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/ | |
| */ | |
| const amqp = require('amqplib'); | |
| const exchange = 'yourExchangeName'; | |
| const queue = 'yourQueueName'; | |
| const queueBinding = 'yourQueueBindingName'; | |
| // Message consumer |
| const crypto = require('crypto'); | |
| let accessToken = 'your fb accesstoken' || 'facebookClientId' + '|' + 'facebookClientSecret' | |
| let clientSecret = 'your fb client secret' | |
| let appsecret_proof: crypto.createHmac('sha256', clientSecret).update(accessToken).digest('hex') |
| #!/bin/bash | |
| # empty Trash | |
| rm -rf ~/.local/share/Trash/* | |
| # output to stdout & file | |
| ls | tee file.txt | |
| # output to stdout & append to file | |
| ls | tee -a file.txt |
| #!/bin/bash | |
| # Get IP Address of all containers | |
| docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq) | |
| # remove all containers | |
| docker rm -f $(docker ps -aq) | |
| # remove all images | |
| docker rmi -f $(docker images -q) |