Skip to content

Instantly share code, notes, and snippets.

@marclar
marclar / docker-cleanup-resources.md
Created May 18, 2018 17:35 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

Keybase proof

I hereby claim:

  • I am marclar on github.
  • I am marclar (https://keybase.io/marclar) on keybase.
  • I have a public key ASBOpsmWR106eQ3kS_lphfIrsAjOA6MwgD8y7aEMMd4ulwo

To claim this, I am signing this object:

@marclar
marclar / blockchain-ideas.md
Created November 9, 2017 15:41
Some ideas for the 2017 Hackathon

Infrastructure stuff

Might be good to establish some best practices for common blockchain / smart contract scenarios.

  • Given that contracts are immutable, how can we release new versions? Maybe using a proxy contract that only points to the latest revision?
  • How can we schedule future executions?, Maybe by attaching a reward for whomever executes this contract at a certain date?

Tools

  • "bit" - easy CLI wallet with commands similar to Git. e.g., bit clone , bit add @, bit commit -m "Sending to , bit push. Important to have lots of autocomplete and help - see Keybase for a good CLI example.

Keybase proof

I hereby claim:

  • I am marclar on github.
  • I am marclar (https://keybase.io/marclar) on keybase.
  • I have a public key ASCEzH8oVGapuQwYtMCHiI-KX-iEZrWY6hXLgfyH5I9Bjgo

To claim this, I am signing this object:

{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "*** lambdas",
"Parameters": {
"aaLambdaRoleArn": {
"Type": "String",
"Default": "***"
}
},
"Resources": {
@marclar
marclar / Page.js
Created September 18, 2015 17:29
When using aliases, server-side rendering won't work unless you explicitly pass the aliased methods to @connect => dispatch
import * as actions from 'redux/modules/content/page';
import {page} from 'redux/modules/content';
import {load as getPage} from 'redux/modules/content/page';
@connect(
state => ({
page: state.content.page.data,
error: state.content.page.error,
loading: state.content.page.loading
import superagent from 'superagent';
export default function loadInfo() {
return new Promise((resolve) => {
superagent.get(config.remoteApiBase + '/info').then( (res) => {
resolve(res.body);
}, (err) => {
reject(err);
});
### Keybase proof
I hereby claim:
* I am marclar on github.
* I am marclar (https://keybase.io/marclar) on keybase.
* I have a public key whose fingerprint is 544C 62DF 992B 7384 65ED D227 C62E 5BEB A128 AC5A
To claim this, I am signing this object:
var myApp = angular.module('myApp').config(function($httpProvider) {
$httpProvider.defaults.headers.post['X-CSRFToken'] = $('input[name=csrfmiddlewaretoken]').val();
});
@marclar
marclar / app.js
Created June 23, 2013 15:14
Node.js sockets; under construction and assumes lo-dash, AngularJS and jQuery; maybe more.
//Assuming "app.io" is your socket.io object....
app.io.configure(function (){
//On handshake,
app.io.set('authorization', function (handshake, accept) {
//Require headers
if(handshake.headers){