#Simple MongoDB Security Tutorial
###1 - Start mongod without any "security option"
$ mongod --port 27017
local api = vim.api | |
local ctrlv = api.nvim_replace_termcodes('<C-V>', true, true, true) | |
local function exit_vmode() | |
local mode = vim.fn.mode() | |
if mode == 'v' or mode == 'V' or mode == ctrlv then | |
vim.cmd('normal! ' .. mode) | |
end | |
end |
import { useEffect, useRef, useState } from 'react'; | |
export const useCountDown: ( | |
total: number, | |
ms?: number, | |
) => [number, () => void, () => void, () => void] = ( | |
total: number, | |
ms: number = 1000, | |
) => { | |
const [counter, setCountDown] = useState(total); |
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( |
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( |
" With this function you can reuse the same terminal in neovim. | |
" You can toggle the terminal and also send a command to the same terminal. | |
let s:monkey_terminal_window = -1 | |
let s:monkey_terminal_buffer = -1 | |
let s:monkey_terminal_job_id = -1 | |
function! MonkeyTerminalOpen() | |
" Check if buffer exists, if not create a window and a buffer | |
if !bufexists(s:monkey_terminal_buffer) |
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - | |
echo "Installing NodeJS 6.x" | |
sudo apt-get install nodejs | |
echo "Install webpack globally" | |
sudo npm install webpack -g | |
echo "Install nightwatch globally" | |
sudo npm install nightwatch -g |
# docker build -t ubuntu1604py36 | |
FROM ubuntu:16.04 | |
RUN apt-get update && \ | |
apt-get install -y software-properties-common && \ | |
add-apt-repository ppa:jonathonf/python-3.6 | |
RUN apt-get update | |
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv | |
RUN apt-get install -y git |
#!/bin/sh | |
KERNEL_VERSION="3.13.0-29" | |
sudo apt-get update | |
sudo aptitude install -y linux-image-${KERNEL_VERSION}-generic \ | |
linux-headers-${KERNEL_VERSION} linux-image-extra-${KERNEL_VERSION}-generic | |
sudo sed -i "s/GRUB_DEFAULT=.*/GRUB_DEFAULT=\"Advanced options for Ubuntu>Ubuntu, with Linux ${KERNEL_VERSION}-generic\"/" /etc/default/grub | |
sudo update-grub |
function lastSunday(month, year) { | |
var d = new Date(); | |
var lastDayOfMonth = new Date(Date.UTC(year || d.getFullYear(), month+1, 0)); | |
var day = lastDayOfMonth.getDay(); | |
return new Date(Date.UTC(lastDayOfMonth.getFullYear(), lastDayOfMonth.getMonth(), lastDayOfMonth.getDate() - day)); | |
} | |
function isBST(date) { | |
var d = date || new Date(); | |
var starts = lastSunday(2, d.getFullYear()); |
#Simple MongoDB Security Tutorial
###1 - Start mongod without any "security option"
$ mongod --port 27017