Skip to content

Instantly share code, notes, and snippets.

@danny460
danny460 / index.js
Created April 15, 2022 17:12
Scraping PropertyGuru with puppeteer because searching sucks
const puppeteer = require('puppeteer');
const converter = require('json-2-csv');
const fs = require('fs');
const readline = require('readline');
(async () => {
let allListings = [];
let offset = 1;
while (true) {
@danny460
danny460 / introrx.md
Created June 21, 2017 07:18 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@danny460
danny460 / getURLParam.js
Created March 17, 2017 08:59
get url parameter regex in browser
function getURLParam(name, url){
url = url || location.search;
url.startsWith("?") || (url="?"+url);
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(url) || [null, ''])[1].replace(/\+/g, '%20')) || null;
}
getURLParam("a", "a=AAA&b=BBB&c=CCC");
//AAA
getURLParam("ba", "a=AAA&b=BBB&c=CCC");
//null