Skip to content

Instantly share code, notes, and snippets.

View ZekeSnider's full-sized avatar

Zeke ZekeSnider

View GitHub Profile
@christopherjohst
christopherjohst / ProgrammaticTableView.swift
Last active July 28, 2022 02:30
A complete example showing how to construct an NSTableView programmatically (no NIB!) and take care of the small issues like column spacing. Complete description of this example here: https://kitcross.net/nstableview-in-playgrounds/
import AppKit
import PlaygroundSupport
let tableViewFrame = NSRect(x: 0, y: 0, width: 250, height: 500)
class TableViewController: NSViewController {
let tableView: NSTableView = {
let tableView = NSTableView()
// By default a tableview has column spacing. We only have
@chris-rock
chris-rock / crypto-buffer.js
Last active May 30, 2024 15:57
Encrypt and decrypt buffers in nodejs
// Part of https://github.com/chris-rock/node-crypto-examples
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq';
function encrypt(buffer){
var cipher = crypto.createCipher(algorithm,password)
var crypted = Buffer.concat([cipher.update(buffer),cipher.final()]);
return crypted;