Skip to content

Instantly share code, notes, and snippets.

View agonbina's full-sized avatar

Agon Bina agonbina

  • Commercetools GmbH
  • Berlin
View GitHub Profile

Keybase proof

I hereby claim:

  • I am agonbina on github.
  • I am agonbina (https://keybase.io/agonbina) on keybase.
  • I have a public key whose fingerprint is 6F32 0892 FFBC 0914 241C 8B6E 16F2 8995 9FC8 8F62

To claim this, I am signing this object:

@agonbina
agonbina / index.ts
Last active September 24, 2020 16:52
import {
EventBridgeLambda,
EventsQueue,
FilterPolicyType,
getResourceNameWithPrefix,
LambdaFunction,
QueueLambda,
relativeRootPath,
SNSLambda
} from '@getcaya/infra'
function ensureRefs (vm, type) {
if (!vm[type]) {
vm[type] = Object.create(null)
vm[type]['__handlers__'] = Object.create(null)
}
}
function bind (vm, { type, key, source }) {
const handlers = vm[type]['__handlers__']
@agonbina
agonbina / esnextbin.md
Last active June 2, 2016 20:13
esnextbin sketch
#!/bin/bash
if [ "$GIT_SSH_KEY" != "" ]; then
echo "Cleaning up SSH config" >&1
echo "" >&1
# Now that npm has finished running,
# we shouldn't need the ssh key/config anymore.
# Remove the files that we created.
rm -f ~/.ssh/config
rm -f ~/.ssh/deploy_key
@agonbina
agonbina / testfile
Last active August 29, 2015 14:17
1aim framework
# Framework
A constructor that will hold the global state of an application.
```js
function Framework(options) {
this.version = options.v || 'v1'
}
```
The following sections describe the concepts we can bundle in the Framework.
### SESSION
@agonbina
agonbina / index.js
Last active August 29, 2015 14:16
requirebin sketch
var Map = require('indexed-map')
var Store = require('datastore')
var rooms = Map()
var keys = Map()
var equipment = Map()
var equipmentSpecs = Map()
rooms.insert('keys', keys)
rooms.insert('equipment', equipment)
@agonbina
agonbina / index.js
Created November 26, 2014 08:08
requirebin sketch
var Vue = require('vue')
var sortableMixin = require('vue-sortable-mixin')
var appTemplate =
'<ul>' +
'<li v-repeat="positions">{{$index}} : {{$value}}<li>' +
'</ul>';
var app = new Vue({
@agonbina
agonbina / index.js
Last active August 29, 2015 14:06
requirebin sketch
var Model = require('store-model');
var Store = require('datastore');
var Enumerable = require('enumerable-component');
var User = Model({
properties: [{
username: { type: 'string' }
}]
});
@agonbina
agonbina / jsbin.EJARafU.html
Created October 20, 2013 01:47
Separating command and query(setter/getter) of an object, enforcing command invocation(in this case a validation function) when a setter is called, making the dependent variable 'private' by making the constructor a closure, and using the ECMA5 Object.preventExtensions to block any further (mutation?) on the instances created by the constructor(…
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>