Skip to content

Instantly share code, notes, and snippets.

View linus-amg's full-sized avatar

Linus Gubenis linus-amg

  • Mexico, Berlin
  • 08:29 (UTC -06:00)
View GitHub Profile
@linus-amg
linus-amg / behavior.coffee
Created August 30, 2015 00:03
the behavior
class window.Behaviors.Socket extends Marionette.Behavior
onRender: ->
console.log 'asd'
@linus-amg
linus-amg / itemview.coffee
Created August 30, 2015 00:04
use the behavior
class RowView extends Marionette.ItemView
tagName: 'tr'
template: require './row.hbs'
behaviors:
Socket: true
@linus-amg
linus-amg / index.coffee
Created August 30, 2015 00:04
behaviorsLookup
Marionette.Behaviors.behaviorsLookup = ->
return window.Behaviors = {}
@linus-amg
linus-amg / index.js
Created October 21, 2015 18:26 — forked from max-mapper/index.js
requirebin sketch
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,
@linus-amg
linus-amg / ref.js
Created November 5, 2015 19:03
ref
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
# 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
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;
@linus-amg
linus-amg / serverless.yml
Created January 17, 2017 20:24
serverless yml restApi howto?
accounts:
handler: handler.accounts
events:
- http:
handler: setup
method: POST
path: account/setup
integration: lambda
cors: true
- http:
@linus-amg
linus-amg / README.md
Created January 19, 2017 02:18 — forked from rcknr/README.md
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
linus-amg / cloudSettings
Last active October 17, 2021 19:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-10-17T19:23:18.513Z","extensionVersion":"v3.4.3"}