ssh -nNT -L LOCALPORT:DESTINATION:DESTPORT SSHACCOUNT
To forward localhost:5000 to destination.net:80:
# Standalone Django script | |
# | |
# Ideal for quickly testing some code. | |
# | |
# 1. Place at the root of your project | |
# 2. Edit the variable PROJECT_NAME | |
# 3. Run it: python sandbox.py | |
import os |
import React, { useState } from 'react'; | |
import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap'; | |
export default function MyTabs(props) { | |
const [activeTab, setActiveTab] = useState('1'); | |
return ( | |
<div> | |
<Nav tabs> | |
<NavItem> | |
<NavLink className={activeTab == '1' ? 'active' : ''} onClick={() => setActiveTab('1')}> |
#!/bin/bash | |
API="http://10.1.1.13/sm/webservice/rest/server.php" # WS entry point. | |
COURSEID=25 # Course to duplicated. | |
CATEGORYID=1 # Category to duplicate to. | |
TOKEN="490b48f8cd71e88a37fa70cc6eff3fb2" # WS Token. | |
# SCRIPT STARTS HERE. | |
SUFFIX=`date +"%s"` |
# Edit using: | |
# git config -e --global | |
[user] | |
name = Me | |
email = email@example.com | |
[alias] | |
ap = add -p | |
au = add -u | |
bl = branch -l |
import Axios from 'axios'; | |
import { setupCache } from 'axios-cache-adapter'; | |
import localforage from 'localforage'; | |
import find from 'lodash/find'; | |
import isEmpty from 'lodash/isEmpty'; | |
const CACHE_MAX_AGE = 2 * 60 * 60 * 1000; | |
// Extracting 'axios-cache-adapter/src/exclude' as importing it leads to webpack not compiling it. | |
function exclude(config = {}, req) { |
<VirtualHost *:80> | |
DocumentRoot /var/www/dirforbidden | |
<Directory /var/www/dirforbidden> | |
# Local machine only | |
Require local | |
# Broader local network | |
Require ip 192.168 | |
Require ip 10 | |
</Directory> |
import Axios from 'axios'; | |
import { setupCache } from 'axios-cache-adapter'; | |
import exclude from 'axios-cache-adapter/src/exclude'; | |
// Define the cache adapter. | |
const cacheAdapter = setupCache({ | |
clearOnStale: false, | |
}); | |
const getKey = cacheAdapter.config.key; |
(function() { | |
let overlay; | |
let node = document.elementFromPoint(window.innerWidth / 2, window.innerHeight / 2); | |
while (true) { | |
if (!node.parentNode || node.tagName === 'BODY') break; | |
const styles = getComputedStyle(node); | |
if (styles['overflow'] === 'hidden') { | |
overlay = node; | |
} |