Skip to content

Instantly share code, notes, and snippets.


Dewey Sia deweysia

View GitHub Profile
justinatack / Quasar Framework Login Form Card Component Example
Last active Nov 5, 2021
Quasar Framework Login Form Card Component Example
View Quasar Framework Login Form Card Component Example
<q-page class="bg-light-green window-height window-width row justify-center items-center">
<div class="column">
<div class="row">
<h5 class="text-h5 text-white q-my-md">Company & Co</h5>
<div class="row">
<q-card square bordered class="q-pa-lg shadow-1">
<q-form class="q-gutter-md">
mjdietzx /
Last active Dec 15, 2021
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
# install CUDA Toolkit v8.0
# instructions from (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
morgangiraud /
Last active Dec 11, 2020
Script to reinstall manually nvidia drivers,cuda 9.0 and cudnn 7.1 on Ubuntu 16.04
# Remove anything linked to nvidia
sudo apt-get remove --purge nvidia*
sudo apt-get autoremove
# Search for your driver
apt search nvidia
# Select one driver (the last one is a decent choice)
sudo apt install nvidia-370
joshnuss / app.js
Last active Jan 4, 2022
Express.js role-based permissions middleware
View app.js
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
baraldilorenzo /
Last active Jan 13, 2022
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition
K. Simonyan, A. Zisserman
basham /
Last active Jan 14, 2022
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

grantland /
Last active Nov 25, 2021
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
kimmobrunfeldt / node-exports-styles.js
Last active Nov 23, 2021
A few Node module export styles. 1 seems to be the most used and I prefer it
View node-exports-styles.js
// Style 1
// Export all manually
// Good: Calling functions inside the module is convenient
// Bad: module.exports becomes verbose and it's tedious to add new functions
function a() {