This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [width, height] = [10,10] // 10x10 matrix | |
const element = (index) => index; | |
// lets create the flat array first | |
const array = Array.from({length: width * height}, (_,index) => element(index)); | |
// lets create the proxy handler | |
// we return the 'row' of the index by filtering the respective elements |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useContext} from 'react'; | |
import { useRouteMatch } from 'react-router-dom'; | |
import UserContext from '../context/UserContext'; | |
import routes from './routes'; | |
const EnabledRoute = (props) => { | |
const { roles } = useContext(UserContext); | |
const { name, exact, component: Component } = props; | |
const { role, route: path } = routes.find(route => route.name === name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controller; | |
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; | |
class SecurityController extends AbstractController | |
{ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jul 10 16:21:42 texfbggzw01 kernel: IN=eth0 OUT=eth0 SRC=195.124.8.1 DST=10.106.122.211 LEN=52 TOS=0x00 PREC=0x00 TTL=124 ID=6467 DF PROTO=TCP SPT=62397 DPT=3389 WINDOW=64896 RES=0x00 SYN URGP=0 | |
Jul 10 16:21:45 texfbggzw01 kernel: IN=eth0 OUT=eth0 SRC=195.124.8.1 DST=10.106.122.211 LEN=52 TOS=0x00 PREC=0x00 TTL=124 ID=6478 DF PROTO=TCP SPT=62397 DPT=3389 WINDOW=64896 RES=0x00 SYN URGP=0 | |
Jul 10 16:21:51 texfbggzw01 kernel: IN=eth0 OUT=eth0 SRC=195.124.8.1 DST=10.106.122.211 LEN=52 TOS=0x00 PREC=0x00 TTL=124 ID=6486 DF PROTO=TCP SPT=62397 DPT=3389 WINDOW=64896 RES=0x00 SYN URGP=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by iptables-save v1.4.7 on Wed Jul 10 16:13:49 2019 | |
*nat | |
:PREROUTING ACCEPT [360:24859] | |
:POSTROUTING ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
-A PREROUTING -d 10.106.3.96/32 -p tcp -m tcp --dport 60000 -j DNAT --to-destination 10.106.122.211:3389 | |
-A POSTROUTING -d 10.106.122.221/32 -p tcp -m tcp --dport 3389 -j SNAT --to-source 10.106.3.96 | |
-A POSTROUTING -o eth0 -j MASQUERADE | |
-A POSTROUTING -j LOG | |
-A OUTPUT -d 10.106.3.96/32 -p tcp -m tcp --dport 60000 -j DNAT --to-destination 10.106.122.221 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=>(g=(a,b)=>b?g(b,a%b):a,[c=(n.match(/[b-df-hj-np-tv-z]/gi)||[]).length,v=(n.match(/[aeiou]/gi)||[]).length],`${c==0?1:v/g(v,c)}:${v==0?1:c/g(v,c)}`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const urls = ['foo', 'bar','baz']; | |
// for-of | |
for (const url of urls) { | |
const result = await fetch(url); | |
console.log(result); | |
} | |
// reduce | |
urls.reduce((chain, url) => chain.then(fetch(url)), Promise.resolve()).forEach(result => console.log(result)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### khadgar handmage | |
# Class: Mage | |
# Format: Standard | |
# Year of the Dragon | |
# | |
# 2x (2) Acidic Swamp Ooze | |
# 2x (2) Book of Specters | |
# 2x (2) Firetree Witchdoctor | |
# 1x (2) Khadgar | |
# 2x (2) Sunfury Protector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trap "echo 'hello'; exit" 1 | |
ssh [email protected] | |
#other shell | |
kill -1 12345 | |
# 'hello' is not printed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope.isBeforeMinDate = (month, first) => { | |
const { year } = scope.currentSelection; | |
const date = moment(`${first ? '01' : '15'}-${month}-${year}`, 'DD.MM.YYYY'); | |
$log.info("GOING TO RETURN ", !!(scope.earliestMoment && date.isBefore(scope.earliestMoment))); | |
return (scope.earliestMoment && date.isBefore(scope.earliestMoment)) ? true : false; | |
} |
NewerOlder