Skip to content

Instantly share code, notes, and snippets.

View Roughtron's full-sized avatar

Svyatoslav Zytsar Roughtron

  • Curitiba, Brazil
View GitHub Profile
@Roughtron
Roughtron / forwarding-example.md
Created June 13, 2016 11:23 — forked from f1sherman/forwarding-example.md
Port Forwarding Example in OS X El Capitan

Add the following to /etc/pf.anchors/myname:

rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 4000
rdr pass on lo0 inet proto tcp from any to any port 443 -> 127.0.0.1 port 4001

Add the following to /etc/pf-myname.conf:

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/myname"
var matrixExample = [
[ 1, 2, 3, 4 ],
[ 4, 5, 6, 5 ],
[ 7, 8, 9, 7 ],
[ 7, 8, 9, 7 ]
];
function sumMainDiagonal(matrix) {
var sum = 0;
for (var i = 0; i < matrix.length; i++) {
describe("isEven", function() {
it("2 is even - return true.", function() {
assert.equal(isEven(2), true);
});
it("0 is even - return true", function() {
assert.equal(isEven(0), true);
});
@Roughtron
Roughtron / widget.js
Last active February 12, 2019 12:07
(function () {
var widgetId = 1
var wrapper
function init () {
wrapper = document.createElement('div')
wrapper.classList.add('giftd-wrapper')
wrapper.style.position = 'fixed'
wrapper.style.zIndex = 10000000