Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Francis Kim franciskim

🎯
Focusing
View GitHub Profile
View puppeteer-test.js
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'});
View index.js
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)
View melbourne-magento-devs.js
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 Mar 15, 2021
Validate URL with JavaScript
View validateUrl.js
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 Jul 21, 2015
Weather Bot for Slack
View slackWeatherBot.js
// 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',