This file contains 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
# Mosh Server on macOS Mojave is blocked by the packet filter. | |
# Modifying the pf.conf for pfctl is not enough to make it work. | |
# The following function does, however, seem to allow the necessary | |
# traffic to pass through the firewall | |
fix_mosh_server() { ✔ 10037 13:10:10 | |
local fw='/usr/libexec/ApplicationFirewall/socketfilterfw' | |
local mosh_sym="$(which mosh-server)" | |
local mosh_abs="$(greadlink -f $mosh_sym)" |
This file contains 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
// Going to create a way to search a rotated array that uses a divide and conquer approach rather than the standard binary tree method | |
var maxNumber = 50000// Or use something like Math.pow(2,31) to create a large binary integer; // A 32 bit integer, since bitwise only works on 32 bit ints | |
function splitList(arr, sections) { | |
// arr = the list we're searching | |
// num = the number we're searching for | |
// sections = the number of sections to break the larger list into | |
var a = []; // Create a new array to hold the multiple arrays |
This file contains 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
.console { | |
font-family: monospace; | |
margin: 2px; | |
} | |
.large { | |
font-size: 1.5em; | |
} | |
/* Define the prompt */ | |
.console p.help:before { | |
content:""; |
This file contains 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
<div class="console large">Console Emulator:</div> | |
<div id="console-log" class="console"> | |
<p class="help">Just use console.log("...") as you normally would.</p> | |
</div> |
This file contains 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
// JS Console Emulator | |
console = { | |
log: function (text) { | |
console.linecount = console.linecount++ || 1; | |
if (console.linecount === 1) $("#console-log").empty(); | |
$("<p/>", { | |
html: text | |
}).appendTo("#console-log"); | |
} | |
}; |