Why?
- Minimal PHP system needed to run CRUD symfony app
- Better understanding of PHP configurations
- Newer sqlite support, like window functions and JSON1 extension
Adapted from
var foo = 5 == 6; // false | |
foo = "6" == 6; // true. Because the number 6 are first converted into a string | |
foo = "6" === 6; // false. It will also check equality of data type. Always use this operator | |
/* | |
&& (AND) | |
|| (OR) | |
! (NOT) | |
*/ |
function sieveOfAtkin(limit){ | |
var limitSqrt = Math.sqrt(limit); | |
var sieve = []; | |
var n; | |
//prime start from 2, and 3 | |
sieve[2] = true; | |
sieve[3] = true; | |
for (var x = 1; x <= limitSqrt; x++) { |
var a = 9 + "7"; // = "97, string" | |
var b = "7" + 9; // = "79 string" | |
var fooInt = parseInt("34s12", 10); //34 | |
fooInt = parseInt("hello", 10); //NaN | |
var fooFloat = parseFloat("3.14", 10); // 3.14 | |
var words = "Cities of the Interior"; | |
alert(words.split(" ")); //can only do split on string | |
// [Cities,of,the,Interior] |
Why?
Adapted from
In /etc/default/grub
, modify:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off"
Then sudo update-grub
brew install mysql@5.7 | |
gem install mysql2 -v '0.4.8' -- --with-ldflags=-L/usr/local/opt/mysql@5.7/lib --with-cppflags=-I/usr/local/opt/mysql@5.7/include |
sudo apt install zram-config
, this will install several files, including systemd startup /etc/systemd/system/multi-user.target.wants/zram-config.service
sudo nano /usr/bin/init-zram-swapping
and edit:#!/bin/sh
# load dependency modules
NRDEVICES=1
if modinfo zram | grep -q ' zram_num_devices:' 2>/dev/null; then
MODPROBE_ARGS="zram_num_devices=${NRDEVICES}"
Better use zswap, as it will work in conjunction with swap devices https://www.addictivetips.com/ubuntu-linux-tips/enable-zswap-on-linux/
In /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=40 zswap.zpool=z3fold"
run sudo update-grub