Skip to content

Instantly share code, notes, and snippets.

Avatar

Rory O’Kane roryokane

View GitHub Profile
@roryokane
roryokane / README.md
Last active Sep 30, 2020
Ruby cheat sheet – how to run a system command (shell command) and know whether it failed
View README.md

The below file is a Markdown conversion of a section of an OmniOutliner document I once wrote. The nested lists below were meant to be collapsed by default, so you could expand only the branches you care about. Sadly, that’s not easy to represent in Markdown, so below you see every detail about every option.

@roryokane
roryokane / keybase.md
Created Dec 4, 2019
Keybase proof (github:roryokane = keybase:roryokane)
View keybase.md

Keybase proof

I hereby claim:

  • I am roryokane on github.
  • I am roryokane (https://keybase.io/roryokane) on keybase.
  • I have a public key ASAwywESLvZnuiuY3IA3ptHDwB8sLIlEwqm6Aii5BG8DFQo

To claim this, I am signing this object:

@roryokane
roryokane / Security of Software, Distribution Models_ It’s More Than Open vs Closed!.md
Last active May 10, 2019
formatted version of “Security of Software, Distribution Models: It’s More Than Open vs Closed!” by Nick P.
View Security of Software, Distribution Models_ It’s More Than Open vs Closed!.md

A formatted version of https://pastebin.com/EZQWbwCB to make it easier to read. Written by Nick P., not by me. There is discussion on Lobste.rs.


Security of Software, Distribution Models: It’s More Than Open vs Closed!

(originally 2014 on Schneier’s blog; revised 2018)

I’ve noticed in recent debates a false dichotomy: you can have “open source” or proprietary, but not benefits of both. Developers thinking there’s only two possibilities might miss opportunities. This is especially true for users or buyers that are concerned about source copying, ability to repair things, or backdoors. The good news is there are many forms of source distribution available. The trustworthiness of review process also varies considerably. I’m going to briefly run through some of them here.

@roryokane
roryokane / kernighan_2015-10-20_q&a_notes.md
Last active Oct 21, 2015
A summarized transcript of Brian Kernighan’s 2015-10-20 Q&A at Paperless Post
View kernighan_2015-10-20_q&a_notes.md

A summarized transcript of Brian Kernighan’s 2015-10-20 Q&A

The Q&A was at Paperless Post on 2015-10-20 from 6 to 8 PM.

Transcribed by Rory O’Kane. Typed on a phone and cleaned up later.

Questions from the moderator

First, some questions from an employee of Paperless Post, starting around 6:35 PM.

@roryokane
roryokane / exploration_of_this.js
Last active Oct 15, 2017
Summary of this, call, and bind in JavaScript
View exploration_of_this.js
// exploring `this` in JavaScript, and `.call` and `.bind`
// our cast
anna = {name: "Anna"};
zach = {name: "Zach"};
// how `this` works
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
View find collisions between rounded HUSL triads.js
function intTo2DigitHex(integer) {
if (integer < 16) {
return '0' + integer.toString(16)
} else {
return integer.toString(16)
}
}
function findCollisions(numDigitsRounding, quitAfterFindingOne) {
var knownHusls = {};
@roryokane
roryokane / 1 – myers (default) algorithm.diff
Last active Jun 7, 2020
Comparison between Git diff algorithms: myers (default) vs. patience (example favors myers)
View 1 – myers (default) algorithm.diff
diff --git a/file.txt b/file.txt
index 3299d68..accc3bd 100644
--- a/file.txt
+++ b/file.txt
@@ -1,7 +1,7 @@
+abc
aaaaaa
aaaaaa
bbbbbb
bbbbbb
@roryokane
roryokane / 1 – myers (default) algorithm.diff
Last active May 22, 2022
Comparison between Git diff algorithms: myers (default) vs. patience (example favors patience)
View 1 – myers (default) algorithm.diff
diff --git a/file.c b/file.c
index 6faa5a3..e3af329 100644
--- a/file.c
+++ b/file.c
@@ -1,26 +1,25 @@
#include <stdio.h>
-// Frobs foo heartily
-int frobnitz(int foo)
+int fib(int n)
@roryokane
roryokane / readme.md
Last active Aug 29, 2015 — forked from anonymous/readme.txt
Pegs in PuzzleScript – version hosted for puzzlescript.net
View readme.md
@roryokane
roryokane / ExampleFilter.java
Created Mar 17, 2014
Java generic pipe and filter classes, plus examples
View ExampleFilter.java
package pipe_foundations.example;
import pipe_foundations.Pipe;
import pipe_foundations.SimpleFilter;
public class ExampleFilter extends SimpleFilter<Integer, String> {
public ExampleFilter(Pipe<Integer> input, Pipe<String> output) {
super(input, output);
}