After a long time researching and trying to figure out how to sync sessions and cookies through many webviews this was the best final working aproach that I came with
... (wip)
#!/bin/sh | |
set -e | |
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' | | |
while read path_key local_path | |
do | |
url_key=$(echo $path_key | sed 's/\.path/.url/') | |
url=$(git config -f .gitmodules --get "$url_key") | |
git submodule add $url $local_path |
stringToBytes('this is a test'); | |
function stringToBytes(str) { | |
var ch, st, re = []; | |
for (var i = 0; i < str.length; i++ ) { | |
ch = str.charCodeAt(i); // get char | |
st = []; // set up "stack" | |
do { | |
st.push( ch & 0xFF ); // push byte to stack | |
ch = ch >> 8; // shift value down by 1 byte |
function dc_trace_cmd() { | |
local parent=`docker inspect -f '{{ .Parent }}' $1` 2>/dev/null | |
declare -i level=$2 | |
echo ${level}: `docker inspect -f '{{ .ContainerConfig.Cmd }}' $1 2>/dev/null` | |
level= level + 1 | |
if [ "${parent}" != "" ]; then | |
echo ${level}: $parent | |
dc_trace_cmd $parent $level | |
fi | |
} |
function dc_trace_cmd() { | |
local parent=`docker inspect -f '{{ .Parent }}' $1` 2>/dev/null | |
declare -i level=$2 | |
echo ${level}: `docker inspect -f '{{ .ContainerConfig.Cmd }}' $1 2>/dev/null` | |
level=level+1 | |
if [ "${parent}" != "" ]; then | |
echo ${level}: $parent | |
dc_trace_cmd $parent $level | |
fi | |
} |
############################################################################### | |
# Helpful Docker commands and code snippets | |
############################################################################### | |
### CONTAINERS ### | |
docker stop $(docker ps -a -q) #stop ALL containers | |
docker rm -f $(docker ps -a -q) # remove ALL containers | |
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter | |
# helps with error: 'unexpected end of JSON input' |
function reloadFrame(iframe) { | |
iframe.parentNode.replaceChild(iframe.cloneNode(), iFrame); | |
} |
[ | |
// Basic drag select | |
{ | |
"button": "button1", "count": 1, | |
"press_command": "drag_select_callback" | |
}, | |
{ | |
// Select between selection and click location | |
"button": "button1", "modifiers": ["shift"], | |
"press_command": "drag_select_callback", |