This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP FUNCTION IF EXISTS get_set_data; | |
CREATE OR REPLACE FUNCTION get_set_data(setId integer) | |
RETURNS jsonb AS $$ | |
-- --------------------------------------------- | |
-- Selects set as JSON | |
-- --------------------------------------------- | |
select jsonb_build_object( | |
'set_id', s.id, | |
'set_name', s.name, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP FUNCTION IF EXISTS get_family_data; | |
CREATE OR REPLACE FUNCTION get_family_data(familyId integer) | |
RETURNS jsonb AS $$ | |
WITH counts AS ( | |
SELECT | |
f.id AS family_id, | |
COUNT(DISTINCT i.id) AS icons_count, | |
COUNT(DISTINCT il.id) AS illustrations_count, | |
COUNT(DISTINCT s.id) AS sets_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
/* add this in your settings.json (command + shit +p > Preferences : Open User Settings (JSON) */ | |
{ | |
"editor.tokenColorCustomizations": { | |
"textMateRules": [ | |
{ | |
"name": "storage.type.class.jsdoc", | |
"scope": "storage.type.class.jsdoc,entity.name.type.instance.jsdoc,variable.other.jsdoc", | |
"settings": { | |
"foreground": "#7f848eff" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE accounts( | |
id serial PRIMARY KEY, | |
name VARCHAR(256) NOT NULL | |
); | |
CREATE TABLE entries( | |
id serial PRIMARY KEY, | |
description VARCHAR(1024) NOT NULL, | |
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
-- Every entry is a credit to one account... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ProductRepository as MedusaProductRepository } from "@medusajs/medusa/dist/repositories/product"; | |
import { Repository as MedusaRepository, Utils } from "medusa-extender"; | |
import { EntityRepository, In } from "typeorm"; | |
import { Product } from "./product.entity"; | |
@MedusaRepository({ override: MedusaProductRepository }) | |
@EntityRepository(Product) | |
export default class ProductRepository extends Utils.repositoryMixin<Product, MedusaProductRepository>(MedusaProductRepository) { | |
public async bulkAddToSet( | |
productIds: string[], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
############################################################ | |
# Help # | |
############################################################ | |
Help() | |
{ | |
# Display Help | |
echo "Increment the latest tag and create a new tag & release." | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swap two variables, set to integers, | |
// without using a third variable. | |
// Any language you want, but no Assembly. | |
// Register swaps are cheating for | |
// this riddle. | |
let x = 3 | |
let y = 5 | |
console.log(x, y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var docRef = app.activeDocument; | |
var dialog = new Window("dialog"); | |
dialog.text = "Escolha Cilindro"; | |
dialog.preferredSize.width = 400; | |
dialog.orientation = "column"; | |
dialog.alignChildren = ["left", "top"]; | |
dialog.spacing = 10; | |
dialog.margins = 16; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doResizeArtboards(width, height) { | |
if (app.documents.length === 0) { | |
alert("There are no open documents."); | |
return; | |
} | |
var theDoc = app.activeDocument; | |
try { | |
for (i = 0; i < theDoc.artboards.length; i++) { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# System Preferences -> Accessibility -> Display -> Reduce motion | |
tell application "Messages" to activate | |
tell application "Messages" | |
set chatCount to (count of chats) | |
end tell | |
tell application "System Events" | |
tell process "Messages" |
NewerOlder