Skip to content

Instantly share code, notes, and snippets.

@eskiel777
eskiel777 / app.js
Created June 10, 2020 18:30 — forked from joshnuss/app.js
Express.js role-based permissions middleware
// 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 "./permission"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection

Setting up SSH Keys for Gitlab

( Mac & Windows Instructions )

Step 1 - Generate SSH Keys

Generate SSH Key by running the following command:

Mac Users Windows Users
Open your terminal open the Git Bash terminal
@HikariKnight
HikariKnight / emoji-toggle.md
Last active July 5, 2020 18:06
ibus emoji toggle
#!/bin/bash
#### CONFIG
ibus_default_layout="xkb:no::nor"
layout="no"
#### END OF CONFIG

ibus_layout=$(ibus engine)
if [[ "$ibus_layout" == $ibus_default_layout ]]; then
 echo Setting ibus to uniemoji
-- Toggle redshift when viewing videos with mpv
-- When pausing redshift is reenabled (and disabled again when continuing)
-- This script assumes that redshift is running
rs_enabled = true
function rs_toggle()
os.execute("pkill -x -USR1 redshift")
end
@pravnkay
pravnkay / Readme.md
Last active November 22, 2024 03:31
Nprogress - Loading bar for VueJS Router

Installation of Nprogress for VueJS

Install nprogress.

npm install nprogress --save


Add its CSS

@isomorphisms
isomorphisms / gist:3114ab86960656a729a6b4653001aae2
Created November 27, 2019 06:08
how to pull from docker hub using podman/buildah
On void linux.
Under `/etc/containers/` there is a file called `registries.conf`. It is complemented by `man 5 containers-registries.conf`.
Change (for me lines 11-12) which say
[registries.search]
registries = []
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@iki
iki / docker-compose.yml
Created September 15, 2019 20:12
Docker-compose nginx CORS proxy
version: '3.7'
services:
whoami:
image: jwilder/whoami
ports:
- 127.0.0.1:7000:8000
cors:
package seed
import (
"log"
"github.com/jinzhu/gorm"
"github.com/victorsteven/fullstack/api/models"
)
var users = []models.User{
@denniske
denniske / custom-solution.dart
Last active May 30, 2021 09:48
Flutter Modal bottom sheet will not overlap keyboard (Fixed)
import 'package:flutter/material.dart';
class CustomPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(),
floatingActionButton: FloatingActionButton(
onPressed: () {
showModalBottomSheet(