This file contains hidden or 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
mutation AddUser { | |
insert_users(objects: {id: "user-id-1101", name: "Rohan Bagchi", email: "[email protected]"}) { | |
returning { | |
id | |
name | |
} | |
} | |
} |
This file contains hidden or 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 Employee(name, age, emp_id) { | |
this.name = name; | |
this.age = age; | |
this.emp_id = emp_id; | |
} | |
function Accountant(name, age, emp_id) { | |
Employee.call(this, name, age, emp_id); | |
this.role = "accountant"; | |
} |
This file contains hidden or 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
class Employee { | |
String name; | |
int age; | |
String emp_id; | |
public Employee(String name, int age, String emp_id) { | |
this.name = name; | |
this.age = age; | |
this.emp_id = emp_id; | |
} | |
This file contains hidden or 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, { useEffect } from 'react'; | |
import get from 'lodash/get'; | |
import noop from 'lodash/noop'; | |
interface useOutsideClickHandlerProps { | |
node: any, // reference to top level node / element in the collapsible component. | |
onOutsideClick: (data?: any) => void, | |
onInsideClick?: (data?: any) => void, | |
} |
This file contains hidden or 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 getNameFieldValue = (data: any) => data.foo; | |
const shouldReinitialize = () => !props.shouldReinitialize; | |
<InnerField | |
fieldData={innerFieldData} | |
getFieldValue={getNameFieldValue} | |
shouldReinitialize={shouldReinitialize} | |
> | |
{({ handleChange: innerHandleChange, value }: any) => { | |
return ( |
This file contains hidden or 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 innerFieldData = { | |
id: props.selectedItem.id, | |
...values, // formik's form field values | |
}; | |
const getFieldUniqueId = (data: any) => data.id; | |
<InnerField | |
fieldData={innerFieldData} | |
getFieldValue={(innerFieldData: any) => innerFieldData['itemDescription']} |
This file contains hidden or 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, { useState, useEffect } from "react"; | |
interface ChildrenPropType { | |
handleChange: (e: any) => void, | |
value: string | |
} | |
interface PropType { | |
fieldData: any, | |
shouldReinitialize: (data: any) => Boolean, |
This file contains hidden or 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
router.get('/download', function(req, res) { | |
res.set('Content-Disposition', 'attachment; filename=Some Fancy Data.xls') | |
res.set('Access-Control-Expose-Headers', 'Content-Disposition,X-Suggested-Filename') | |
res.json(downloadData); | |
}); |
This file contains hidden or 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
<!-- Code for Action: MedLife - Universal Pixel - Test Campaign --> | |
<!-- Begin Sizmek DSP Conversion Action Tracking Code Version 9 --> | |
<script type='text/javascript'> | |
(function() { | |
var w = window, d = document; | |
var s = d.createElement('script'); | |
s.setAttribute('async', 'true'); | |
s.setAttribute('type', 'text/javascript'); | |
s.setAttribute('src', '//c1.rfihub.net/js/tc.min.js'); | |
var f = d.getElementsByTagName('script')[0]; |
This file contains hidden or 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 btn = document.getElementById("calculate_btn"); | |
const res = document.getElementById("result"); | |
btn.addEventListener("click", e => { | |
res.innerHTML = "Loading..."; | |
const val = doLongCalculation(); | |
const shortenedData = val.slice(0, 50).join(", ") + "..."; | |
res.innerHTML = shortenedData; | |
}); | |
})(); |