Skip to content

Instantly share code, notes, and snippets.

Linus Gubenis linus-amg

Block or report user

Report or block linus-amg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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`};
}
`;
@linus-amg
linus-amg / cloudSettings
Last active Aug 20, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-08-20T10:01:56.838Z","extensionVersion":"v3.4.1"}
@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:
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:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab
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
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,
You can’t perform that action at this time.