Skip to content

Instantly share code, notes, and snippets.

View nicolaslopezj's full-sized avatar
🎯
Focusing

Nicolás López Jullian nicolaslopezj

🎯
Focusing
View GitHub Profile
@nicolaslopezj
nicolaslopezj / reservations_data.ts
Created July 22, 2024 14:19
Categorías de reservas
import {Prop, TypedSchema} from '@orion-js/typed-model'
@TypedSchema()
export class StoreProfileTagCategoryValue {
@Prop()
value: string
@Prop()
label: string
}
@nicolaslopezj
nicolaslopezj / autoincrement.js
Created April 25, 2019 18:56
Autoincremente con Orionjs
import {Collection} from '@orion-js/app'
const Counters = new Collection({
name: 'autoIncrement_counters',
indexes: [
{
keys: {name: 1},
unique: true
}
]
@nicolaslopezj
nicolaslopezj / permissions.json
Last active December 26, 2018 14:04
Waves permissions
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"acm:*",
"acm-pca:*",
"cloudfront:*",
"elasticbeanstalk:*",
"ec2:*",
@nicolaslopezj
nicolaslopezj / index.js
Last active November 8, 2018 16:03
field array
import React from 'react'
import styles from './styles.css'
import PropTypes from 'prop-types'
import Text from 'orionsoft-parts/lib/components/fields/Text'
import clone from 'lodash/clone'
import Button from 'orionsoft-parts/lib/components/Button'
import autobind from 'autobind-decorator'
import IconButton from 'orionsoft-parts/lib/components/IconButton'
import DeleteIcon from 'react-icons/lib/md/delete'
orion build --output "$BUILD_DIR/build"
conditionsgroup
const finalquery = {$or: []}
for (const group of conditionsgroup) {
const groupQueries = {$and: []}
for (const conditions of group) {
const query = { /* generar query */ }
groupQueries.$and.push(query)
}
@nicolaslopezj
nicolaslopezj / privacy.txt
Created May 12, 2018 23:00
Política de privacidad
Los datos que compartas solo serán usados para contactarte y no serán compartidos con nadie
@nicolaslopezj
nicolaslopezj / CallOrionx.js
Last active March 27, 2018 22:03
Llamar a Orionx desde Node
import JSSHA from 'jssha'
import rp from 'request-promise'
export default async function(query, variables, apiKey, apiSecretKey) {
// New actual Time-Stamp
const timestamp = new Date().getTime() / 1000
const body = JSON.stringify({query, variables})
const shaObj = new JSSHA('SHA-512', 'TEXT')
shaObj.setHMACKey(apiSecretKey, 'TEXT')
@nicolaslopezj
nicolaslopezj / checkBchile.js
Created January 6, 2018 12:57
Checkea transferencias en el banco de chile
/* global $ */
function marcar(amountToTransfer, fecha, bchile) {
let total = 0
$('.linea1tablaSB input[type=checkbox]').map(function() {
const input = $(this)
const tr = input.parent().parent()
const fileNameTr = tr.prev().prev()
const fileName = fileNameTr.find('td:not([align=right]) strong').text()
const date = fileName.split(' ')[2] + ' ' + fileName.split(' ')[3]
const cuenta = $(tr.find('td')[5]).find('div:first').text().trim()
// Main.js
import withGraphQL from 'react-apollo-decorators/lib/withGraphQL'
import gql from 'graphql-tag'
import Content from './Content'
@withGraphQL(gql`query getMyData ($section: String) {
dataForSection (section: $section) {
...${Content.fragmentName}
}
}`, {