This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Add this to your <activity>, so any link (clicked in fi. an e-mail) | |
will open your app instead of the website, but only if it matches these whitelisted path patterns | |
*/ | |
<activity android:launchMode="singleInstance"><!-- set the launchMode property to this value! --> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW"/> | |
<category android:name="android.intent.category.DEFAULT"/> | |
<category android:name="android.intent.category.BROWSABLE"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Solves the problem with open ports with docker and ufw | |
# As Docker uses the nat table, the filter table FORWARD chain is used and does not touch ufw-input chains as expected. | |
# Even for ufw-forward chains it would not work, as DOCKER chains are inserted in front. | |
# This is a simple fix that worked for me. | |
INTERFACE_NAME=eth0 | |
__clear(){ | |
sed -i '/^# dockerfix start/,/^# dockerfix end/d' $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
# Solves the problem with open ports with docker and ufw | |
# As Docker uses the nat table, the filter table FORWARD chain is used and does not touch ufw-input chains as expected. | |
# Even for ufw-forward chains it would not work, as DOCKER chains are inserted in front. | |
# This is a simple fix that worked for me. | |
# https://github.com/moby/moby/issues/4737#issuecomment-420264979 | |
# Unfortunately this fix stops forwarding users origin ip to host mode configured service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
function parseImagesFromCSS(doc) { | |
var i, j, | |
rule, | |
image, | |
pattern = /url\((.*)\)/, | |
properties = ['background-image', '-webkit-border-image'], | |
images = {}; | |
if (doc.styleSheets) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2011 10gen | |
# | |
# Modified by Antonin Amand <antonin.amand@gmail.com> to work with gevent. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |