Skip to content

Instantly share code, notes, and snippets.

View lizacodes's full-sized avatar
🌸

Liza lizacodes

🌸
  • Building @kimia-ai
  • Australia
  • 22:53 (UTC +11:00)
View GitHub Profile
@lizacodes
lizacodes / 02b-advent-of-code-2020.js
Last active December 5, 2020 08:42
Advent of Code - Day 2
const fs = require('fs').promises;
const isPasswordValid = (password, policy) => {
const policyBreakdown = /(\d+)-(\d+) ([a-z])/ig;
const [, min, max, letter] = policyBreakdown.exec(policy)
if (password[min-1] === letter && password[max-1] === letter) {
return false;
}
@lizacodes
lizacodes / 02a-advent-of-code-2020.js
Last active December 6, 2020 22:43
Advent of Code 2020 - Day 2
const fs = require('fs').promises;
const isPasswordValid = (password, policy) => {
const policyBreakdown = /(\d+)-(\d+) ([a-z])/ig;
const [, min, max, letter] = policyBreakdown.exec(policy)
const letterPattern = new RegExp(letter, 'ig')
const letterCount = password.match(letterPattern)
if (!letterCount) {
@lizacodes
lizacodes / 01b-advent-of-code-2020.js
Last active December 2, 2020 23:03
Advent of Code - Day 1
// I kinda hate it but it works ¯\_(ツ)_/¯
const fs = require('fs').promises
const isSum2020 = (a, b, c) => {
return a + b + c === 2020
}
const findOtherInputsThatGivesSumOf2020 = (number, inputs) => {
for (const input of inputs) {
@lizacodes
lizacodes / 01a-advent-of-code-2020.js
Last active December 2, 2020 23:02
Advent of Code 2020 - Day 1
const fs = require('fs').promises
const isSum2020 = (a, b) => {
return a + b === 2020
}
const findOtherInputThatGivesSumOf2020 = (number, inputs) => {
for (const input of inputs) {
if (isSum2020(parseInt(number, 10), parseInt(input, 10))) {
return input;
@lizacodes
lizacodes / IIS_Parallels_Win10_Mac.md
Last active April 29, 2019 06:58 — forked from justingarrick/IIS_Parallels_Win8_Mac.md
Expose IIS or IISExpress running in a Parallels Windows 10 VM to your OS X host

Expose IIS or IISExpress running in a Parallels Windows 10 VM to your OS X host

Add an ACL rule

Open CMD or Powershell as administrator. Add a URL ACL entry for your new name on the port of your choice, e.g.
netsh http add urlacl url=http://windows.local:8080/ user=everyone

Note: windows.local:8080 can be substituted with the name and port of your choice

Add a firewall rule

Open CMD or Powershell as administrator. Add an inbound firewall rule for this new port.

@lizacodes
lizacodes / karma.conf.js
Last active January 18, 2017 08:58
Unit testing configurations for Angular 1.6.x, ES6, Karma, Jasmine, Browserify and Istanbul
let istanbul = require('browserify-babel-istanbul');
module.exports = function(config) {
config.set({
basedir: '.',
files: [
'./node_modules/babel-polyfill/dist/polyfill.js',
'./node_modules/angular/angular.js',
'./node_modules/angular-mocks/angular-mocks.js',