View product-repository.tsx
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[], |
View git-tag-and-release.sh
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 |
View two-variable-swap.js
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) |
View resize-artboards-dropdown.js
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; |
View fn-resize-artboards.js
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++) { | |
/** |
View delete_all_imessage_conversations.applescript
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" |
View download-from-s3.sh
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 | |
# Replace the text PATH_TO_YOUR_DROPBOX_FOLDER with the path to your Dropbox folder (e.g. /home/user/Dropbox) | |
DROPBOX_FOLDER="PATH_TO_YOUR_DROPBOX_FOLDER" | |
# DO NOT CHANGE ANYTHING BELOW THIS LINE | |
# ====================================== | |
PDF_MERGE_WORK_FOLDER="$HOME/pdfmerge" |
View rgb-to-hex.js
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
const hexToRgb = (hex) => { | |
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) | |
return result ? { | |
r: parseInt(result[1], 16), | |
g: parseInt(result[2], 16), | |
b: parseInt(result[3], 16) | |
} : null; | |
} | |
module.exports.hexToRgb = hexToRgb; |
NewerOlder