Skip to content

Instantly share code, notes, and snippets.

View gilinachum's full-sized avatar

Gili Nachum gilinachum

View GitHub Profile
#!/bin/bash
# /home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/pip install -U keytar jupyter-server-proxy
echo == INSTALLING CODE-SERVER ==
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.12.0
#########################################
### INTEGRATE CODE-SERVER WITH JUPYTER
#########################################
echo == UPDATING THE JUPYTER SERVER CONFIG ==
import qrcode
qr = qrcode.QRCode(version=3, box_size=15, border=15) #box_size is QR dimension and border is thickness
data = "https:~/~/www.amazon.com"
qr.add_data(data)
image = qr.make_image(fill='black', back_color='white')
@gilinachum
gilinachum / MobileLikeSmallHeapDuringTestsEnforce
Last active December 27, 2015 02:49
Max heap enforcer. Makes sure your unit tests heap size, on the PC, is not larger than the heap size of the Android device your developing for (24m-64m). Otherwise your code will rock on the PC, but get an OOME on the device.
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class MobileLikeSmallHeapDuringTestsEnforce {
public static final long MB = 1024 * 1024;
public static final long ANDROID_TYPICAL_MAX_HEAP_MB = 24;
public static final String XMX_ARGUMENT = "-Xmx" + ANDROID_TYPICAL_MAX_HEAP_MB + "m";
@Test
public void assertHeapIsMobileLikeSmall() {