Skip to content

Instantly share code, notes, and snippets.

View donedgardo's full-sized avatar

Edgardo Carreras donedgardo

View GitHub Profile
@donedgardo
donedgardo / Auctionator.lua
Created December 11, 2023 00:12
Auctionatordata
This file has been truncated, but you can view the full file.
AUCTIONATOR_CONFIG = {
["show_selling_bag_2"] = true,
["no_price_database"] = false,
["search_no_filters_matched_entry"] = true,
["selling_groups_settings"] = {
},
["enchant_tooltips"] = false,
["selling_grey_post_button"] = true,
["columns_buying_auctions_2"] = {
@donedgardo
donedgardo / server.ts
Created November 3, 2018 20:56
Apollo-server 2.0 setup graphqlshield
import { ApolloServer } from "apollo-server-express";
import { importSchema } from "graphql-import";
import { makeExecutableSchema } from "graphql-tools";
import { applyMiddleware } from "graphql-middleware";
import * as path from "path";
import { Prisma } from "./generated/prisma";
import resolvers from "./resolvers";
import permisions from "./resolvers/permisions";
@donedgardo
donedgardo / es6_17.json
Created February 8, 2017 22:54
ES6 Article
{
"data": {
"updateFoodTruck": {
"logo": "changed.png",
"name": "FoodTruck Updated 2",
"location": [
33.4424,
-21.222
]
}
@donedgardo
donedgardo / es6_16.js
Created February 8, 2017 22:53
ES6 Article
`mutation UpdateTruck($update: FoodTruckUpdateInput!) {
updateFoodTruck(input: $update){
logo
name
location
}
}
# Query Variables
{
"update": {
@donedgardo
donedgardo / es6_15.js
Created February 8, 2017 22:52
ES6 Article
this.model('FoodTrucks')
.findOneAndUpdate(
{
_id: foodTruckId,
owner: currentUser._id
}, // The food truck to update
{ $set: updatedProperties}, // The update
{ new: true } // Return the modified version
).exec((err, data) => {
if (err) reject(err);
@donedgardo
donedgardo / es6_14.js
Created February 8, 2017 19:56
ES6 Article
// Convert Array into Object
let updatedProperties = Object.assign({}, …notNullArray);
@donedgardo
donedgardo / es6_13.js
Created February 8, 2017 19:55
ES6 Article
Object.assign(target, ...sources)
// Example
var obj = { a: 1 };
var copy = Object.assign({}, obj);
console.log(copy); // { a: 1 }
@donedgardo
donedgardo / es6_12.js
Created February 8, 2017 19:55
ES6 Article
// Example
var parts = ['shoulders', 'knees'];
var lyrics = ['head', ...parts, 'and', 'toes']; // ["head", "shoulders", "knees", "and", "toes"]
@donedgardo
donedgardo / es6_11.js
Created February 8, 2017 19:54
ES6 Article
// Filter function to check what property was left null.
// notNullArray is now a an array with key whose values are not null
let notNullArray = arrayWithNulls.filter((prop) => {
// prop is an an element of the array (eg. {image: null})
for (var key in prop) {
// if the value of prop[key] is not null return it.
// eg. (key = image, and prop = { image:null } Won't return.
if(prop[key]){
return prop;
}
@donedgardo
donedgardo / es6_10.js
Created February 8, 2017 19:53
ES6 Article
console.log(arrayWithNulls); // [
// { image: null },
// { logo: null },
// { name: 'Updated FoodTruck Name'},
// { takingOrders: null },
// { available: null },
// { location: null },
// ];