Skip to content

Instantly share code, notes, and snippets.

View jovinbm's full-sized avatar

Jovin Mwilanga jovinbm

View GitHub Profile
@jovinbm
jovinbm / article.json
Created March 30, 2022 18:55
Pubmed Sample Article
{
"article": {
"?properties": "",
"front": {
"journal-meta": {
"journal-id": ["Neurophotonics", "Neurophotonics", "NEUROW", "NPh"],
"journal-title-group": { "journal-title": "Neurophotonics" },
"issn": ["2329-423X", "2329-4248"],
"publisher": {
"publisher-name": "Society of Photo-Optical Instrumentation Engineers"
@jovinbm
jovinbm / version.js
Created February 4, 2017 17:42
Rendering different html based on browser group
/*
* This middleware parses the request user-agent string to detect the browser name and version.
* Versions are in two groups: main and mini
* We use various criteria to place a user into one of these groups e.g, we make heavy use of object-fit css property
* and so any browser that does not support it is best served the mini version
* */
const parser = require('ua-parser-js');
module.exports = function (req, res, next) {
@jovinbm
jovinbm / opera_mini_in_africa_fixed_pos.html
Created February 4, 2017 16:24
Fixed positioning experiment.
<html>
<head>
<meta name="viewport"
content="width=device-width">
<style>
*, *:before, *:after {
/*
* LocalStorage Sample Wrappers
* For browsers that don't support localStorage yet, we are going to catch those errors and return undefined
* */
/**
*
* @param {string} key
* @param {*} data
* @returns {*}
@jovinbm
jovinbm / opera_mini_in_africa_subscribe.html
Created February 4, 2017 00:50
Simple subscribe to newsletter page
<html>
<head>
<title>I Love You</title>
</head>
<body>
@jovinbm
jovinbm / opera_mini_in_africa_love.html
Last active February 4, 2017 00:13
A simple website that tells a user that we love them
<!--A simple website that tells a user that we love them-->
<html>
<head>
<title>I Love You</title>
</head>
@jovinbm
jovinbm / install-redis.sh
Created March 6, 2016 18:34 — forked from four43/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.github.com/four43/e00d01ca084c5972f229/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"