Skip to content

Instantly share code, notes, and snippets.

Boolean() or !! (double bang, double negation)?

What's the best way to answer the question "true or false?" in JavaScript

JavaScript does not bother you too much with types (at first), which is both a blessing and a cure. But we all know the Boolean type. Boolean variables can either be true or false. Yes or no.

Every value in JavaScript can be translated into a boolean, true or false. Values that translate to true are truthy, values that translate to false are falsy. Simple.

This is about two ways to make that translation.

@DannyQuah
DannyQuah / 2020.06-D.Quah-Pulse-Secure-Client-on-Ubuntu-Linux.md
Last active April 6, 2025 14:32
Pulse Secure Client on Ubuntu Linux

Pulse Secure Client on Ubuntu Linux

by Danny Quah, June 2020 (revised Jan 2022)

Pulse Secure Client is a VPN client that allows secure connection to a Pulse Connect Secure SSL VPN gateway. Many universities use that latter for faculty, staff, and student access to their computer systems. However, because Linux comes in many different flavors, the standard Pulse Secure Client installer does not always run to completion. (For one, [UWO.ca][] suggests "PulseSecure's understanding of Linux package managers and distributions in general seems very limited.") The user is then either forced to use a Windows machine, somehow, or fail VPN access when traveling with their Linux notebook.

This Gist describes the steps I took to install Pulse Secure Client on my Ubuntu-based Linux machines, including a Pixelbook running GalliumOS 3.1 and Dell desktops running Ubuntu 18.04 and 20.04. Other writeups elsewhere that I've looked at describe the same problems I encountered, but were either out-dated, overly localised,

@BenSampo
BenSampo / deploy.sh
Last active August 22, 2025 10:49
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@scotthaleen
scotthaleen / docker_kill.sh
Last active September 8, 2021 07:13
docker kill all
#stop all containers:
docker kill $(docker ps -q)
#remove all containers
docker rm $(docker ps -a -q)
#remove all docker images
docker rmi $(docker images -q)
#remove intermediate containers, use "build --rm" to avoid them
@carltondickson
carltondickson / gist:b14d72d9d3631f870c48
Last active March 26, 2023 15:18
mysqldump export and zip
# Exporting entire database:
mysqldump -u user -p database --opt | gzip > database.sql.gz
# Export table
mysqldump -uroot --opt --databases DB_NAME --tables TABLE_NAME | gzip > /tmp/TABLE_NAME.export.sql.gz
# Importing:
gunzip < database.sql.gz | mysql -u user -p database
# Credit http://failshell.io/mysql/using-gzip-and-gunzip-with-mysql-to-importexport-backups/
@robertgreiner
robertgreiner / post.html
Created April 23, 2012 20:06
Creating a Gist that looks good on your blog and is compatible with Google Reader
<p>
<script src="https://gist.github.com/<gist_id>.js"> </script>
<noscript>
<pre>
//Your code here
//Be sure you escape your tags with &lt; and &gt; when displaying things like HTML.
</pre>
</noscript>
</p>