Skip to content

Instantly share code, notes, and snippets.

View svallory's full-sized avatar
:bowtie:
Coding like there's no tomorrow

Saulo Vallory svallory

:bowtie:
Coding like there's no tomorrow
View GitHub Profile
@svallory
svallory / App.svelte
Created May 24, 2023 17:28
SomeSwing
<script lang="ts">
let name: string = "world";
</script>
<h1>Hello asdf {name}!</h1>
@svallory
svallory / value-object-proxied-base-class.ts
Created January 25, 2023 21:19
Magic catch-all method in Typescript class by extending Javascript Proxy class to build the perfect Value Object base class
type Setters<Type> = {
[Property in keyof Type as `set${Capitalize<string & Property>}`]: (newValue: Type[Property]) => Type & Setters<Type>
};
abstract class VO<T> {
constructor(
public readonly type: any,
public readonly excludedProperties: string[],
) {
return (new Proxy(this, {
@svallory
svallory / foo.md
Created December 17, 2022 02:42
Testing Gists VS extension

hehehe

@svallory
svallory / ui.disl
Created December 15, 2022 21:09
Disl for UI
ui Web
/**
* Defines a context for the screens
* A context is a set of screens that are related to each other.
* It can have preconditions that are checked before allowing the user to
* navigate to the screens in the context.
*
* A context can have preconditions that are checked before allowing the user
* to navigate to the screens in the context.
*
@svallory
svallory / Emoji and Unicode.txt
Created December 8, 2022 18:42
Just playing with possible meaning of emojis in code
Commands: 🎮 🕹 ⚙ ⌨ 🎚 🎛 ⌘ 🚦 🚥 🙏 🙏🏼 ⌃ ^
Receive: 📥 📩 📨 📬
Publish: 📰 📢
Change: ⚡️
Negative: 🚫 🛑 ❌ ❎ ⤫
Warning: ⚠️ 🚨 🚧 ⛔ ⚠️⚠
Notify: 🔔 🎉 📟 📢 📣 🗣 🔊
Mail: 📨 📤 📥 📧 📩 📪 📫 📬 📭 📮 📦
Time: ⏰ ⏱ ⏲ ⏳ ⌛ ⧗ ⧖
Movement: 🚀 🛫 🛬
@svallory
svallory / gist:3650672
Created September 6, 2012 03:22
AutoMapper Two-way mapping
Mapper.CreateMap<Design, DesignSubmitViewModel>()
.ForMember(d => d.Tags, opt => opt.MapFrom(d => d.Tags.Aggregate("", (total, tag) => total + (tag.Name + ", ")).Trim(' ',',')));
Mapper.CreateMap<DesignSubmitViewModel, Design>()
.ForMember(d => d.Competition, opt => opt.Ignore())
.ForMember(d => d.Tags, opt => opt.MapFrom(d => d.Tags.Split(',').Select(name => new Tag() { Name = name.Trim() })));
@svallory
svallory / test-index.js
Created April 4, 2019 12:20
VSCode Stryker Mutator test
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/* tslint:disable no-require-imports */
const fs = require("fs");
const path = require("path");
const glob = require("glob");
const paths = require("path");
const istanbul = require('istanbul');
@svallory
svallory / nginx-config
Last active February 20, 2018 18:42
Nginx Wildcard config
server {
listen 80;
server_name ~^(www\.)?(?<project>.+?).dev$;
root /projects/$project;
index index.html index.htm index.php;
charset utf-8;
location / {
@svallory
svallory / run_them_all.sh
Created April 27, 2017 11:14
Updates ubuntu with nodejs 6 and yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get update && sudo apt-get install -y nodejs yarn
@svallory
svallory / font-awesome-mixins.less
Created August 30, 2012 04:04
FonAwesome Icons using Mixins instead of classes (Please see the first comment)
/* Font Awesome
the iconic font designed for use with Twitter Bootstrap
-------------------------------------------------------
The full suite of pictographic icons, examples, and documentation
can be found at: http://fortawesome.github.com/Font-Awesome/
License
-------------------------------------------------------
The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0:
http://creativecommons.org/licenses/by/3.0/ A mention of