Do yourself a favor, and instal Bun (a replacement for NodeJS) and run it with Bun
import { initializeApp } from "firebase/app";
import { getFirestore, collection, getDocs, addDoc } from 'firebase/firestore/lite';
Do yourself a favor, and instal Bun (a replacement for NodeJS) and run it with Bun
import { initializeApp } from "firebase/app";
import { getFirestore, collection, getDocs, addDoc } from 'firebase/firestore/lite';
asdf plugin-add perl # gotta install for each language
asdf list-all perl # show all available version #s
asdf install perl 5.38.0
asdf global perl 5.38.0 #(do this!!!, more info below)
asdf plugin list all | grep -i graal # see if there's a plugin for graalvm or graal or something like that
Gotchas in perl 7 | |
Class: | |
- you can't just initialize any field using a constructor. | |
: it must have :param on it | |
field $employee_number: param; | |
set -e | |
cat > prime.rs <<EOF | |
#[no_mangle] | |
pub extern "C" fn is_prime(n: u64) -> bool { | |
if n <= 1 { | |
return false; | |
} | |
// check if even | |
if n % 2 == 0 { | |
return n == 2; |
package MyRealArray; | |
use Moose; | |
use namespace::autoclean; | |
has 'arr' => ( | |
is => 'rw', | |
isa => 'ArrayRef', | |
default => sub { [] }, | |
); |
# Sources: | |
# Mastering Object-Oriented Perl Programming (OOP): Unleashing the Power of OOP in Perl (YouTube, last 2 minutes!!!!) | |
# Docs for Moose::Meta::Attribute::Native::Trait::Array | |
# probably at: https://metacpan.org/pod/Moose::Meta::Attribute::Native::Trait::Array | |
# GlobalStuff.pm in current directory | |
package GlobalStuff; | |
use Moose; | |
has 'name' => (is=>'ro' , isa=>'Str' , default=>''); |
# We'll create Scramble::Game and test it. | |
# Adapted from book "Perl Medic" (Chapter on Testing) | |
h2xs -AXn Scramble::Game | |
cd Scramble-Game | |
perl Makefile.PL | |
make test | |
mv t/Scramble-Game.t t/01_basics.t | |
sed -i '/t\/Scramble-Game.t/ d' MANIFEST # remove .t file from MANIFEST | |
perl -0777 -i.original -pe 's/\A.*use strict/#\/usr\/bin\/perl\nuse strict/igsm' t/01_basics.t | |
perl -0777 -i.original -pe 's/^###.*$//igsm' t/01_basics.t |
sudo apt-get install -y python3.6 python3-pip virtualenv mongodb | |
sudo systemctl start mongodb | |
virtualenv -p /usr/bin/python3.6 --distribute myproject | |
source myproject/bin/activate | |
pip install --upgrade pip | |
python -m pip install pymongo | |
pip install PyZen | |
cat > test_mongo.py <<EOL | |
import unittest | |
from pymongo import MongoClient |
If this link doesn't work, go to next step: | |
https://github.com/jasmine/jasmine/releases | |
download latest version of standalone jasmine from that link or search Google for "standalone jasmine". | |
Follow this tutorial: | |
https://code.tutsplus.com/tutorials/testing-your-javascript-with-jasmine--net-21229 | |
Here's my version of the code: | |
// src/convert.js | |
function Convert(iAmount, sUnitFrom) { |
sudo apt-get install -y curl | |
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - | |
sudo apt-get update | |
sudo apt-get install -y nodejs | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
sudo apt-get update && sudo apt-get install -y yarn | |
yarn init -y | |
yarn add karma karma-jasmine karma-chrome-launcher jasmine-core | |
sudo yarn global add karma-cli |