Skip to content

Instantly share code, notes, and snippets.

View franciskim's full-sized avatar
🎯
Focusing

Francis Kim franciskim

🎯
Focusing
View GitHub Profile
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
headless: false
});
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
const YahooFinanceAPI = require('yahoo-finance-data')
// fill in Yahoo Finance API keys here
const api = new YahooFinanceAPI({
key: null,
secret: null
})
const talib = require('talib')
console.log("TALib Version: " + talib.version)
var Promise = require('bluebird');
var MongoDB = Promise.promisifyAll(require("mongodb"));
var MongoClient = Promise.promisifyAll(MongoDB.MongoClient);
var cheerio = require('cheerio');
var http = require('http');
var urls = [
'http://www.magentocommerce.com/certification/directory/index/?q=&country_id=AU&region_id=&region=vic&certificate_type=',
'http://www.magentocommerce.com/certification/directory/index/?q=&country_id=AU&region_id=&region=victoria&certificate_type='
];
@franciskim
franciskim / validateUrl.js
Last active March 15, 2021 14:39
Validate URL with JavaScript
function validateUrl(value)
{
var expression = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi
var regexp = new RegExp(expression);
return regexp.test(value);
}
@franciskim
franciskim / slackWeatherBot.js
Created July 21, 2015 14:53
Weather Bot for Slack
// please leave this notice intact, otherwise do as you please :)
// by hello@franciskim.co
// get more info at http://franciskim.co/2015/07/22/how-to-create-a-weather-bot-for-slack-chat/
var express = require('express');
var app = express();
var http = require('http');
var Slackhook = require('slackhook');
var slack = new Slackhook({
domain: 'yoursubdomain',