(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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 |
jQuery(function($) { | |
$('form[data-async]').live('submit', function(event) { | |
var $form = $(this); | |
var $target = $($form.attr('data-target')); | |
$.ajax({ | |
type: $form.attr('method'), | |
url: $form.attr('action'), | |
data: $form.serialize(), |
@Rule | |
public TestRule loggingRule = new TestWatcher() { | |
protected void starting(Description description) { | |
Logger logger = LoggerFactory.getLogger(description.getClassName()); | |
logger.info("Starting: {}", description.getMethodName()); | |
} | |
}; |
public static String getExternalSdCardPath() { | |
String path = null; | |
File sdCardFile = null; | |
List<String> sdCardPossiblePath = Arrays.asList("external_sd", "ext_sd", "external", "extSdCard"); | |
for (String sdPath : sdCardPossiblePath) { | |
File file = new File("/mnt/", sdPath); | |
if (file.isDirectory() && file.canWrite()) { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
package object utils { | |
/** | |
* Helper that allows to call private methods on Scala/Java objects. | |
* | |
* Usage: `someObject.exposeMethod('methodName)(arg1, arg2, arg3)` | |
* | |
* See: https://gist.github.com/EugenyLoy/5873642543f869c7e25f | |
*/ | |
implicit class ExposePrivateMethods(obj: AnyRef) { |
[ | |
"Automotive", | |
"Budgeting", | |
"HVAC", | |
"Heaters", | |
"Hydraulics", | |
"Logistics Management", | |
"Management", | |
"Negotiation", | |
"Project Planning", |
curl -i https://api.github.com/repos/EugenyLoy/awesome-github > `date -u '+%F'_%H_%M`.txt |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// 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
Searching --------------------------------------------------------------------- | |
Find all files that has full filename pattern "YYY" in this rdirectory, recursive: | |
find . -wholename "YYY" | |
Find all matches of regexp "XXX" in file YYY: | |
grep -n -E "XXX" YYY | |
Find all occurences of "XXX" in all files with name "YYY" in this directory, recursive: | |
find . -name "YYY" -print0 | xargs -0 grep -n -F "XXX" |