Skip to content

Instantly share code, notes, and snippets.

getHeaderHeight() {
const element = this.refWrapper.current.querySelector('th');
const height = element.offsetHeight;
this.refWrapper.current.style.setProperty('--header-height', height + 'px');
};
onResize() {
getHeaderHeight();
}
const container = {
maxHeight: 600,
overflowY: 'auto',
':before': {
background: 'linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0,0,0,0.1) 100%)',
content: '""',
display: 'block',
height: 12,
left: 0,
marginBottom: '-12px',
import { cx, css } from 'emotion';
const button = {
background: black,
color: white,
'& + &': {
marginLeft: '8px',
}
};
const buttonPrimary = {
background: red,
import { cx, css } from 'emotion';
const button = {
background: black,
color: white,
'& + &': {
marginLeft: '8px',
}
};
const buttonPrimary = {
background: red,
const button = {
background: black,
color: white,
'& + &': {
marginLeft: '8px',
}
};
const buttonPrimary = {
background: red,
};
.button {
background: black;
color: white;
&.primary {
background: red;
}
&.secondary {
background: green;
}
}
<button class="button primary>Primary Button Text</button>
<a class="button secondary" href="">Secondary Button Text</a>
<div class="button-group">
<a class="button primary" href="">Primary Button Text</a>
<a class="button secondary" href="">Secondary Button Text</a>
</div>
Create Port Forward:
netsh interface portproxy add v4tov4 listenport=<From Port> listenaddress=<From IP> connectport=<To Port> connectaddress=<To IP>
Remove Port Forward:
netsh interface portproxy delete v4tov4 listenport=<From Port> listenaddress=<From IP>
#!perl -w
# usage: portforward 18025:mail.messagingengine.com:25
#where 18025 is the TCP port on the local machine and
# mail.messagingengine.com:25 is where that port is forwarded to.
# Based on: http://www.perlmonks.org/bare/?node_id=367253
use Socket;
use IO::Socket;
use IO::Select;
use strict;
$(document).on('click', 'section.sets a.ajax', function() {
var href = $(this).attr('href');
$.ajax({
url: href,
success: function(data){
console.log(data);
$('section.sets div.items').append($(data).find('section.sets div.items').html());
var href = $(data).find('section.sets a.ajax').attr('href');
$('section.sets a.ajax').attr('href', href);
$(window).on('scroll', onScroll);