Skip to content

Instantly share code, notes, and snippets.

View albertorestifo's full-sized avatar

Alberto Restifo albertorestifo

View GitHub Profile
- return this.prisma.ctrPayrollCompensation.create({
- data: createData,
+ return this.prisma.ctrPayrollCompensation.upsert({
+ where: { idepotencyKey }
+ create: { ...createData, idepotencyKey },
+ update: {},
include: {
rateOfPayUnit: true,
cycle: { include: { recurringFrequency: true, recurringPatterns: true } },
}
@albertorestifo
albertorestifo / create.ts
Last active October 6, 2021 10:02
Example idempotent creation with Prisma
// Suppose createData includes all the other required fields,
// and idempotencyKey is received as part of the request payload.
await this.prisma.ctrPayrollCompensation.upsert({
where: { idempotencyKey },
create: { ...createData, idepotencyKey },
update: {}, // Update nothing
});
Error: instantiating 'Breeze::Requests::ShowPage#perform_render()'
In lib/lucky/src/lucky/html_builder.cr:27:5
27 | render
^-----
Error: instantiating 'render()'
@albertorestifo
albertorestifo / gist:2cc2bab488a39eb60e0c9faa77250eb4
Created August 24, 2019 11:34
Fix font smoothing is VSCode
defaults write com.microsoft.VSCode.helper CGFontRenderingFontSmoothingDisabled -bool NO
@albertorestifo
albertorestifo / sort.js
Created November 28, 2017 15:21
A quick script to sort by stars
const fs = require('fs');
const rp = require('request-promise');
const Promise = require('bluebird');
const list = fs.readFileSync('./list', { encoding: 'utf8' });
const urls = list.split('\n');
const TOKEN = '<YOUR API TOKEN>';
const repos = urls.map((url) => {
@albertorestifo
albertorestifo / ref.js
Created November 6, 2017 11:15
Charts In React - Article resources
import React, { Component } from 'react';
import { select } from 'd3-select';
class LineChart extends Component {
componentDidMount() {
this.renderChart();
}
renderChart() {
const svg = select(this.containerEl);
package main
import (
"bufio"
"fmt"
"log"
"os"
"runtime"
"strings"
"sync"
const fs = require('fs');
const Path = require('path');
const React = require('react');
const ReactDOMServer = require('react-dom/server');
const Email = require('../lib/Email').default;
const STYLE_TAG = '%STYLE%';
const CONTENT_TAG = '%CONTENT%';
{
"name": "react-emails-example",
"version": "0.1.0",
"private": true,
+ "main": "./server/createEmail.js",
"devDependencies": {
+ "babel-cli": "^6.24.1",
+ "babel-preset-react-app": "^2.2.0",
"react-scripts": "0.9.5"
},
@media only screen and (max-width: 650px) {
.title-heading {
font-size: 18px !important; /* We need !important to */
text-align: center !important; /* overcome inline styles */
}
}