Skip to content

Instantly share code, notes, and snippets.

View albertosouza's full-sized avatar
👨‍🔬
Creating things

Alberto Souza albertosouza

👨‍🔬
Creating things
View GitHub Profile
export default class File {
/**
* Returns the appropriate file extension of the file according to the type
*/
extension: string;
/**
* A unique id generated for this file
*/
id: string;
/**
* Script simples para importação de dados de cotação da Bovespa
*
* Requisitos:
* - Node.js instalado
* - instalar as dependencias: npm install extract-zip moment request
*
* Exemplo de uso: node script_simples_importaca_cota_hist_bovespa.js 05022019
*
* Post relacionado: https://albertosouza.net/artigos/22-importando-dados-bovespa
@circa10a
circa10a / easy-soap-request-index.js
Last active May 24, 2021 23:02
easy-soap-request-index.js
const axios = require('axios-https-proxy-fix');
/**
* @author Caleb Lemoine
* @param {object} opts easy-soap-request options
* @param {string} opts.url endpoint URL
* @param {object} opts.headers HTTP headers, can be string or object
* @param {string} opts.xml SOAP envelope, can be read from file or passed as string
* @param {int} opts.timeout Milliseconds before timing out request
* @param {object} opts.proxy Object with proxy configuration
@cjzopen
cjzopen / Organization json-ld
Last active March 29, 2023 17:03
Organization json-ld example
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [{
"@type": "Organization",
"@id": "https://www.example.com/#organization",
"name": "{{ your name }}",
"url": "https://www.example.com/",
"address": "{{ address }}",
"email": "{{ email }}",
@mikehostetler
mikehostetler / bootstrap.js
Created June 20, 2014 13:32
Sails powered script
var extend = require('util')._extend;
var async = require('async');
var Waterline = require('../node_modules/sails/node_modules/waterline');
var couchdb = require('sails-couchdb-orm');
var config = require('../config/adapters').adapters.couchdb;
couchdb.config = extend(couchdb.defaults, config);
module.exports = bootstrap;

Applications of Cognitive Theory in Data Modeling and Software Design

Written as both a refresher course on the mechanics of cognition in human psychology, and as the beginning of a working theory, wherein one might make some deductions from human psychology to broadly advance/improve the design of server software and data models for the industry en masse.

c. Mike McNeil, 2013-2014 All Rights Reserved.

What's the point of this? I think psychology will inevetiably instruct the future of software design, in the same way neurobiology is beginning to impact the hardware engineering industry. >

@mikermcneil
mikermcneil / bootstrap-sails-in-memory.js
Last active December 25, 2015 20:38
Programmatic usage of sails (for testing, core testing, scheduled jobs, build scripts, etc.)
// NOTE:
// you may need to grab the latest version of Sails on the v0.10 branch for some of this to work
var sails = require('sails');
// You can do a lot here, but I'll show a few important ones
var options = {
// Completely disable globals (sails, your models, your services, _, async)
globals: false,
@mikermcneil
mikermcneil / trying-out-0.9.md
Last active December 19, 2015 09:08
How to try out Sails.js 0.9

Sails v0.9 Preview

Installation

# Install a sneak peek of sails.js v0.9.0 (global install):
sudo npm install -g sails@git://github.com/balderdashy/sails.git#development

# Or, to revert to 0.8.94 (current stable release), you can do:
sudo npm install -g sails@0.8.94

A Modest Proposal: Events

Sails.js v0.10

Events are a new feature of the Sails core as of 0.9.

Core events

Lifecycle

@mikermcneil
mikermcneil / plugins_proposal.md
Last active October 19, 2020 08:42
Sails.js v0.9 plugins proposal

A Modest Proposal: Hooks

Sails.js v0.9: Release Cantidate for 1.0

Philosophy

  • The question of what "belongs" in a framework is complex, and depends on your use case. A better question is "what are the defaults?" By pulling all of the current features of Sails into plugins, and then including them by default, we provide full customizability (the possibility of disabling just about everything) without sacrificing all the conveniences Sails developers are used to.
  • Plugins make it easier to contribute, and make modifying the core a much less scary proposition.
  • Node.js is quite minimalist, and super awesome. Let's take a leaf out of Ryan/Isaac's book!
  • Community plugins are fantastic, but to ensure quality, plugins will only be listed on the Sails website/repo when they've met some basic quality assurance testing.