Skip to content

Instantly share code, notes, and snippets.

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
View App.svelte
<script lang="ts">
let name: string = "world";
</script>
<h1>Hello asdf {name}!</h1>
@svallory
svallory / README.md
Created October 25, 2021 00:26
Figma Plugin Development Live Reload
View README.md

Figma Plugin Development Live Reload

  1. Create a run-plugin.sh somewhere in your project
  2. Copy the code from the run-plugin.sh file in this gist
  3. Install nodemon with yarn add --dev nodemon
  4. Add a script in the scripts property of your package.json replacing PLUGIN_CODE_FOLDER by the path to the folder where your plugin code lives
    "scripts": {
    

"livereload": "nodemon --watch PLUGIN_CODE_FOLDER --exec run-plugin.sh"

@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
View value-object-proxied-base-class.ts
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 / Deploying Sharetribe to Heroku.md
Last active January 7, 2023 13:58
Deploying Sharetribe to Heroku
View Deploying Sharetribe to Heroku.md

Deploying to Heroku

  1. Deploy the app to heroku following heroku normal instructions (add link to heroku help)

  2. Set heroku environment variables

    Make sure all the options in config.yml are properly set then run:

     bundle exec rake heroku:config
    
@svallory
svallory / foo.md
Created December 17, 2022 02:42
Testing Gists VS extension
@svallory
svallory / ui.disl
Created December 15, 2022 21:09
Disl for UI
View ui.disl
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
View Emoji and Unicode.txt
Commands: 🎮 🕹 ⚙ ⌨ 🎚 🎛 ⌘ 🚦 🚥 🙏 🙏🏼 ⌃ ^
Receive: 📥 📩 📨 📬
Publish: 📰 📢
Change: ⚡️
Negative: 🚫 🛑 ❌ ❎ ⤫
Warning: ⚠️ 🚨 🚧 ⛔ ⚠️⚠
Notify: 🔔 🎉 📟 📢 📣 🗣 🔊
Mail: 📨 📤 📥 📧 📩 📪 📫 📬 📭 📮 📦
Time: ⏰ ⏱ ⏲ ⏳ ⌛ ⧗ ⧖
Movement: 🚀 🛫 🛬
@svallory
svallory / gist:3650672
Created September 6, 2012 03:22
AutoMapper Two-way mapping
View gist:3650672
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
View test-index.js
'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
View nginx-config
server {
listen 80;
server_name ~^(www\.)?(?<project>.+?).dev$;
root /projects/$project;
index index.html index.htm index.php;
charset utf-8;
location / {