Skip to content

Instantly share code, notes, and snippets.

@linus-amg
linus-amg / cloudSettings
Last active Oct 17, 2021
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2021-10-17T19:23:18.513Z","extensionVersion":"v3.4.3"}
@linus-amg
linus-amg / gist:e6f71705c53becc85a27224d3ee00210
Created Aug 9, 2019
some helpful regex for refactoring stores
View gist:e6f71705c53becc85a27224d3ee00210
(this\.props.)[A-Za-z]+(Store)
(this\.props.)[A-Za-z]+(Service)
(Store).{0,}=.{0,}(this\.props)
View UIStore.js
import { action, observable } from 'mobx';
const DEFAULT_STATE = {
counter: 0,
};
class UIStore {
@observable state;
constructor(initialState = DEFAULT_STATE) {
View bla.js
const StyledModeler = styled(Modeler)`
.djs-palette {
${({ loadingModeler }) => loadingModeler && `display: none`};
}
`;
View gist:351d16157baa926861ee
Usage
Hello world:
$ pm2 start app.js
Raw Examples
# Fork mode
$ pm2 start app.js --name my-api # Name process
@linus-amg
linus-amg / README.md
Created Jan 19, 2017 — forked from rcknr/README.md
Using Let's Encrypt certificates with Amazon API Gateway
View README.md

##Using Let's Encrypt certificates with AWS API Gateway

Before starting off with API Gateway set up it's worth mentioning that certificate configuration for this particular service is so far isn't well integrated, therefore different from other AWS services. Despite it using CloudFrount to serve on custom domains it won't let you customize distributions it creates, however all the limitations of CloudFront naturally apply to API Gateway. The most important in this case is the size of the key, which is limited by 2048 bit. Many tutorials provide ready to use terminal commands that have the key size preset at 4096 bit for the sake of better security. This won't work with API Gateway and you'll get an error message about certificate's validity or incorrect chain which won't suggest you the real cause of the issue. Another consideration is that to add a custom domain to API Gateway you have to have a certif

@linus-amg
linus-amg / serverless.yml
Created Jan 17, 2017
serverless yml restApi howto?
View serverless.yml
accounts:
handler: handler.accounts
events:
- http:
handler: setup
method: POST
path: account/setup
integration: lambda
cors: true
- http:
@linus-amg
linus-amg / handlebars.helpers.js
Created Dec 1, 2014
handlebars helpers 1 (lleva por ejemplo add, substract, divide, modulus, multiply, floor, ceil, round, remainder, sum)
View handlebars.helpers.js
var Utils = helpersUtils.Utils;
var Library = helpersUtils.Library;
var Dates = helpersUtils.Dates;
var HTML = helpersUtils.Html;
Handlebars.registerHelper('first', function (array, count) {
if (!Utils.isUndefined(array)) {
array = Utils.result(array);
if (!Utils.isUndefined(count)) {
count = parseFloat(Utils.result(count));
View globals.js
const w = window;
w.Model = Backbone.Model;
w.Collection = Backbone.Collection;
w.Router = Backbone.Router;
w.ItemView = Marionette.ItemView;
w.LayoutView = Marionette.LayoutView;
w.CollectionView = Marionette.CollectionView;
w.CompositeView = Marionette.CompositeView;
w.AppRouter = Marionette.AppRouter;
View gist:07ffa9a07316c6f0b3c1
window.App = new Marionette.Application
initialize: ->
@layout = new Layout()
onStart: ->
@layout.render()
@region = @layout.getRegion('main')
onStop: (options) ->
@region.empty()
stop: (options) ->
if @onStop