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
/** | |
* Populate a map with the values of an object with nested maps | |
* | |
* @param {Map} map - Map to populate | |
* @param {object} object - Object to use for the population | |
* @param {array} keys - Array of keys of the object | |
* | |
* @return {Map} Populated map | |
*/ | |
function populateMap (map, object, keys) { |
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
componentDidUpdate(prevProps) { | |
console.log('Rrow update diff:'); | |
const now = Object.entries(this.props); | |
const added = now.filter(([key, val]) => { | |
if (prevProps[key] === undefined) return true; | |
if (prevProps[key] !== val) { | |
console.log(`${key} | |
- ${JSON.stringify(val)} |
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
- 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 } }, | |
} |
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
// 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 | |
}); |
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
Error: instantiating 'Breeze::Requests::ShowPage#perform_render()' | |
In lib/lucky/src/lucky/html_builder.cr:27:5 | |
27 | render | |
^----- | |
Error: instantiating 'render()' | |
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
# Path to the Oh-my-zsh install | |
export ZSH=$HOME/.oh-my-zsh | |
# Add all the required portions to the PATH | |
export PATH="/usr/local/opt/ruby/bin:$HOME/bin:$PATH"; | |
# Source NVM | |
source ~/.nvm/nvm.sh | |
# ZSH Configurations |
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
defaults write com.microsoft.VSCode.helper CGFontRenderingFontSmoothingDisabled -bool NO |
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 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) => { |
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 React, { Component } from 'react'; | |
import { select } from 'd3-select'; | |
class LineChart extends Component { | |
componentDidMount() { | |
this.renderChart(); | |
} | |
renderChart() { | |
const svg = select(this.containerEl); |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"os" | |
"runtime" | |
"strings" | |
"sync" |
NewerOlder