Skip to content

Instantly share code, notes, and snippets.

View mapsi's full-sized avatar

Angel Psiakis mapsi

View GitHub Profile
@mapsi
mapsi / go-project-layout.md
Created April 19, 2023 09:35 — forked from candlerb/go-project-layout.md
Suggestions for go project layout

If someone asked me the question "what layout should I use for my Go code repository?", I'd start by asking back "what are you building: an executable, or a library?"

Single executable

Stage 1: single source file

Create a directory named however you want your final executable to be called (e.g. "mycommand"), change into that directory, and create the following files:

@mapsi
mapsi / mapToObj.js
Created August 9, 2022 02:43
Recursive map to object
const mapToObj = (m) =>
Array.from(m).reduce(
(obj, [key, value]) => ({
...obj,
[key]: value instanceof Map ? mapToObj(value) : value,
}),
{},
);
export default { mapToObj };
@mapsi
mapsi / multisigWallet.sol
Created May 18, 2022 17:08
Multi Signature Wallet in Solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract Wallet {
address[] public owners;
uint limit;
uint balance;
uint public totTransfers;
@mapsi
mapsi / serverless-bundle.sh
Created June 30, 2021 10:33
Lazy man's installation of serverless-bundle
npm i -D serverless-bundle
npm r eslint webpack ts-loader typescript css-loader graphql-tag @babel/core babel-eslint babel-loader eslint-loader @babel/runtime @babel/preset-env serverless-webpack source-map-support webpack-node-externals eslint-config-strongloop tsconfig-paths-webpack-plugin fork-ts-checker-webpack-plugin @babel/plugin-transform-runtime babel-plugin-source-map-support
@mapsi
mapsi / buddyworks.json
Created June 9, 2021 20:23
Buddy works permissions for Elastic Beanstalk
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"elasticloadbalancing:RegisterTargets",
"elasticloadbalancing:DescribeTargetGroups",
"logs:CreateLogGroup",
@mapsi
mapsi / gist:05f8a70b057a2963f296be4a1c8935e4
Created April 24, 2021 08:04
Artificial load for testing monitoring tools
dd if=/dev/urandom | gzip -9 >> /dev/null &
@mapsi
mapsi / zsh
Last active December 11, 2020 19:23
new Mac stuffs
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
// https://github.com/sindresorhus/quick-look-plugins
brew install qlcolorcode qlstephen qlmarkdown quicklook-json betterzip qlimagesize suspicious-package quicklookase qlvideo provisionql quicklookapk
brew tap homebrew/cask-fonts
brew install \
@mapsi
mapsi / AbstractEntity.php
Created June 17, 2020 17:50 — forked from wesrice/AbstractEntity.php
Self Validating Value Objects and Entities (Laravel Implementation)
<?php
abstract class AbstractEntity extends AbstractValueObject
{
/**
* Offset Set
*
* @param mixed $offset
* @param mixed $value
*
@mapsi
mapsi / codequality.md
Created July 19, 2019 10:32
Code quality - Codeclimate check
@mapsi
mapsi / .codeclimate.yml
Created July 19, 2019 10:31
Codeclimate PHP config for Laravel projects
---
version: "2"
plugins:
# https://docs.codeclimate.com/docs/duplication
duplication:
enabled: true
config:
languages:
# - ruby:
# - javascript: