Skip to content

Instantly share code, notes, and snippets.

linus-amg / gist:e6f71705c53becc85a27224d3ee00210
Created Aug 9, 2019
some helpful regex for refactoring stores
View gist:e6f71705c53becc85a27224d3ee00210
View UIStore.js
import { action, observable } from 'mobx';
counter: 0,
class UIStore {
@observable state;
constructor(initialState = DEFAULT_STATE) {
View bla.js
const StyledModeler = styled(Modeler)`
.djs-palette {
${({ loadingModeler }) => loadingModeler && `display: none`};
linus-amg / cloudSettings
Last active Oct 17, 2021
Visual Studio Code Settings Sync Gist
View cloudSettings
linus-amg /
Created Jan 19, 2017 — forked from rcknr/
Using Let's Encrypt certificates with Amazon API Gateway

##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 / serverless.yml
Created Jan 17, 2017
serverless yml restApi howto?
View serverless.yml
handler: handler.accounts
- http:
handler: setup
method: POST
path: account/setup
integration: lambda
cors: true
- http:
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 install consolas on mac
# Thanks to this post:
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O
$ cabextract PowerPointViewer.exe
$ cabextract
View ref.js
function ref(obj, str) {
str = str.split(".");
for (var i = 0; i < str.length; i++)
obj = obj[str[i]];
return obj;
var obj = { a: { b: 1, c : { d : 3, e : 4}, f: 5 } }
str = 'a.c.d'
ref(obj, str) // 3
linus-amg / index.js
Created Oct 21, 2015 — forked from maxogden/index.js
requirebin sketch
View index.js
var inherits = require('inherits');
var Game = require('crtrdg-gameloop');
var Entity = require('crtrdg-entity');
var Keyboard = require('crtrdg-keyboard');
inherits(Player, Entity);
function Player(options){
this.position = {
x: options.position.x,