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 myObject = { | |
name: 'myObject', | |
number: 9001, | |
nestedObject: { | |
nestedName: 'nestedName', | |
nestedBasicArray: [1,2,3], | |
nestedObjectArray: [{firstThing: 11, secondThing: 12}, {firstThing: 21, secondThing: 22}, {firstThing: 31, secondThing: 32}] | |
} | |
} |
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 findUniqueSubstrings = (str) => { | |
const arr = [...str].reduce((acc, _, idx) => | |
acc.concat(Array.from({length: str.length}, (_, innerIdx) => | |
str.substring(idx, innerIdx + 1) | |
)), []) | |
return new Set(arr) | |
} | |
findUniqueSubstrings("Your string here") |
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
module main | |
import ( | |
os | |
net | |
net.http | |
net.urllib | |
strings | |
) |
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
printElement(selector) { | |
const elem = document.querySelector(selector) | |
var printWindow = window.open('','PrintWindow', 'width=400,height=200'); | |
html2canvas(elem).then(canvas => { | |
var doc = printWindow.document | |
var img = doc.createElement('img') | |
img.src = canvas.toDataURL('image/png') | |
doc.body.appendChild(img) | |
setTimeout(() => { | |
printWindow.print() |
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
{-# LANGUAGE StrictData #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module QuickType | |
( PGColumn (..) | |
, ComputedFieldName (..) | |
, RoleName (..) | |
, TriggerName (..) | |
, RemoteRelationshipName (..) | |
, RemoteSchemaName (..) |
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
// This file was generated from JSON Schema using quicktype, do not modify it directly. | |
// To parse and unparse this JSON data, add this code to your project and do: | |
// | |
// pGColumn, err := UnmarshalPGColumn(bytes) | |
// bytes, err = pGColumn.Marshal() | |
// | |
// computedFieldName, err := UnmarshalComputedFieldName(bytes) | |
// bytes, err = computedFieldName.Marshal() | |
// | |
// roleName, err := UnmarshalRoleName(bytes) |
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
// To parse this data: | |
// | |
// import { Convert, TableName, QualifiedTable, TableConfig, TableEntry, CustomRootFields, FunctionName, QualifiedFunction, Function, FunctionConfiguration, ObjectRelationship, ObjRelUsing, ObjRelUsingManualMapping, ArrayRelationship, ArrRelUsing, ArrRelUsingFKeyOn, ArrRelUsingManualMapping, InsertPermissionEntry, InsertPermission, SelectPermissionEntry, SelectPermission, UpdatePermissionEntry, UpdatePermission, DeletePermissionEntry, DeletePermission, ComputedField, ComputedFieldDefinition, EventTrigger, EventTriggerDefinition, EventTriggerColumns, OperationSpec, HeaderFromValue, HeaderFromEnv, RetryConf, CronTrigger, RetryConfST, RemoteSchema, RemoteSchemaDef, RemoteRelationship, RemoteRelationshipDef, QueryCollectionEntry, QueryCollection, AllowList, CustomTypes, InputObjectType, InputObjectField, ObjectType, ObjectField, CustomTypeObjectRelationship, ScalarType, EnumType, EnumValue, Action, ActionDefinition, InputArgument, HasuraMetadataV2 } from "./file"; | |
// | |
// const pGColum |
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
<!-- File: `v-switch.vue` --> | |
<script> | |
export default { | |
functional: true, | |
props: { | |
value: { type: [String, Number], required: true } | |
}, | |
render(h, { data, props, scopedSlots }) { | |
const { value } = props | |
const slotFn = value in scopedSlots ? scopedSlots[value] : scopedSlots.default |
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
#! /bin/bash | |
# VERSION NAME SOURCE STATUS DATABASE STATUS | |
# 1594317652188 - Not Present Present | |
# 1594317688377 - Not Present Present | |
# 1594320512973 - Not Present Present | |
# 1594320556497 - Not Present Present | |
function scan_entries_for_not_present() { | |
# timestamp name source status database status |
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 WebSocket = require('ws') | |
const WebSocketAsPromised = require('websocket-as-promised') | |
// SDK Code | |
const socketFactory = (url) => | |
new WebSocket(url, 'graphql-tx', { | |
headers: { | |
'X-Hasura-Tx-Isolation': 'serializable', | |
}, | |
}) |
OlderNewer