diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`
where XXXXX
is the size of the RAM disk in terms of memory blocks.
Notes:
#!/bin/bash | |
# by d4rk3r | |
# A smart way to search for a code | |
# inside your git history whatever the branch you're | |
# -- Setup : | |
# -- After getting the bash script | |
# chmod +x /path/to/gf.sh |
package demo; | |
public interface Node {} |
A> Generate ephemeral encryption keypair | |
A> Bob Identity: harp:v1:identity:nH01kx0xukWDuji3hwNNslj_2YKvp0TdnAB6OPzR1B4:1605982091 | |
A> mPk[Alice => Bob] => KEK: 1TyRX0Azt-w3bsy6bvSJ26StzFvp92PC8FFV_YEQSVY | |
A> Generate DEK | |
A> Encrypt [Msg] with DEK | |
A> Encrypt DEK with KEK | |
A> Send to bob [MasterPub || ts || EphPub || enc(DEK, KEK) || enc(Msg, DEK)] | |
B> Extract MasterPub, ts and Ephemeral Encryption Public key | |
B> Authenticate to PKG |
It took a few years, but I finally understand why member functions of classes in JavaScript aren't automatically bound to their objects, in particular when used in callback arguments.
In most object-oriented languages, functions are members of a class--they exist in memory only once, and when they are called, this
is
simply a hidden argument of the function which is assigned to the object that's calling it. Python makes this explicit by requiring that
the first argument of a class's member function be self
(Python's equivalent of this
--you can name self
whatever you want, but
self
is the convention).
class MyClass:
Noargsconstructors and setters are outdated, 90's style old school Java. They needlessly allow entire categories of defects that are easily avoided by using only allargsconstructors and no setters. Please stop writing code like that.
How many times have you come across (or written) code like this
public class User {
# Use ${idea.home.path} macro to specify location relative to IDE installation home. | |
# Use ${xxx} where xxx is any Java property (including defined in previous lines of this file) to refer to its value. | |
# Note for Windows users: please make sure you're using forward slashes: C:/dir1/dir2. | |
ide.app.name=webstorm | |
ide.config.home=${user.home}/.jetbrains/${ide.app.name} | |
#--------------------------------------------------------------------- | |
# Uncomment this option if you want to customize a path to the settings directory. | |
#--------------------------------------------------------------------- | |
idea.config.path=${ide.config.home}/config |
This is about how to split a GitHub pull request, following a real in-the-wild example.
So it happened that I once wanted to fix a bug (#832) on the shelljs
repository.
I forked the repository, cloned it and created a new branch called ln-directory-dest
. I fixed the bug, created a pull request, and implemented initial review feedback.
At this point, I had added the commits A, B, C, D, E and [F](https://github.com/Loilo/shelljs/commit/946ab48bf5cf9c8aac03407
I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.
This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea
-Xms16m | |
-Xmx6G | |
-XX:ReservedCodeCacheSize=420m | |
-XX:+UseNUMA | |
-XX:+UseG1GC | |
-XX:ConcGCThreads=2 | |
-XX:+G1UseAdaptiveIHOP | |
-XX:+UseGCOverheadLimit | |
-XX:MaxMetaspaceSize=2G | |
-XX:+ParallelRefProcEnabled |