#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
| window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, gotFS, fail); | |
| function fail(error) { | |
| console.log(error) | |
| } | |
| function gotFS(fileSystem) { | |
| fileSystem.root.getDirectory("data", {create: true, exclusive: false}, gotDir, fail); | |
| } |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
| The problem: | |
| I wanted to use the jinja 'map' filter to modify each item in a string, in this simple | |
| example, adding '.conf' to each item. | |
| The 'format' filter in jinja takes arguments (value, *args, **kwargs). Unfortunately, | |
| it uses 'value' as the pattern. When called inside map 'value' is the current item in | |
| the list, or in other words *args as far as format is concerned. So it's the wrong way | |
| around. |
| var Middleware = function() {}; | |
| Middleware.prototype.use = function(fn) { | |
| var self = this; | |
| this.go = (function(stack) { | |
| return function(next) { | |
| stack.call(self, function() { | |
| fn.call(self, next.bind(self)); | |
| }); |
| /** | |
| * Base contract that all upgradeable contracts should use. | |
| * | |
| * Contracts implementing this interface are all called using delegatecall from | |
| * a dispatcher. As a result, the _sizes and _dest variables are shared with the | |
| * dispatcher contract, which allows the called contract to update these at will. | |
| * | |
| * _sizes is a map of function signatures to return value sizes. Due to EVM | |
| * limitations, these need to be populated by the target contract, so the | |
| * dispatcher knows how many bytes of data to return from called functions. |
| // based entirely on this blog post: | |
| // http://druss.co/2016/04/export-all-workouts-from-sports-tracker/ | |
| // unfortunately the original script no longer works, moslty because jQuery is | |
| // no longer available on sports-tracker pages. | |
| // | |
| // I've compiled the changes proposed in the comments in the script below. | |
| // to use the script, login to your sports-tracker account | |
| // change URL to http://www.sports-tracker.com/diary/workout-list | |
| // open browser console (Cmd-Shift-I) |