Skip to content

Instantly share code, notes, and snippets.

Mark Brown markbrown4

Block or report user

Report or block markbrown4

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
markbrown4 / rsa-key-pairs.rb
Created Oct 25, 2019
RSA Key Pair signing in Ruby
View rsa-key-pairs.rb
data = 'hello'
# generate signature and public key
private_key =
signature = private_key.sign(, data)
public_key = private_key.public_key
# verify signature with public key
rsa_key =
rsa_key.verify(, signature, data)
markbrown4 / read-write.js
Created Jan 8, 2019
Read / write access in Flow
View read-write.js
// @flow
// read / write access
type ReadWriteType = {
+readOnly: number | string,
-writeOnly: string
function test(obj: ReadWriteType) {
const read = obj.readOnly;

I'm trying to write a program that replaces a scss function call and doubles the input e.g.


.color {
  margin: spacing(1.5);

.test {
markbrown4 / middleware.js
Last active Nov 24, 2017
simple express-like middleware
View middleware.js
class Middleware {
constructor () {
this.stack = []
use (fn) {
go (next, remaining = this.stack.slice()) {
View css-grid.html
<!DOCTYPE html>
<meta charset="utf-8">
<style media="screen">
body {
font-family: sans-serif;
line-height: 1.15;
View dnd.html
<!DOCTYPE html>
<meta charset="utf-8">
<style media="screen">
@font-face {
font-family: "San Francisco";
font-weight: 200;
src: url("");
View webpack.config.js
const webpack = require('webpack')
const path = require('path')
const extractCommons = new webpack.optimize.CommonsChunkPlugin({
name: 'commons',
filename: 'commons.js'
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const extractCSS = new ExtractTextPlugin('[name].bundle.css')
markbrown4 /
Last active Nov 11, 2016
setup dev machine
Software Updates
App Store -> Xcode
launch xCode
xcode-select --install
defaults write NSGlobalDomain KeyRepeat -int 0
defaults write AppleShowAllFiles YES
ruby -e "$(curl -fsSL"
View iife-semi.js
var eggs = true
(function() {
// => TypeError: true is not a function
View no-semis.js
const Todo = (props, send)=> {
const todo = props.todo
const index = props.index
return html`
${todo.completed ? 'checked' : ''}
onchange=${(e)=> onChange(e, index)}
You can’t perform that action at this time.