Skip to content

Instantly share code, notes, and snippets.

View nybblr's full-sized avatar
🌱
I help developers craft their best work, achieve goals, and never stop growing.

Jonathan Lee Martin nybblr

🌱
I help developers craft their best work, achieve goals, and never stop growing.
View GitHub Profile
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 5, 2024 13:30
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@rob-hills
rob-hills / ubuntu-22.04-mbp-a1707.md
Last active May 3, 2024 17:33
Ubuntu 22.04 on MacBook Pro 2017 (A1707, MBP 14,3)

Summary

Random set of notes and links that have helped me in the saga to get Ubuntu 22.04 up and running on my 2017 MacBook Pro These notes are mainly for myself in the event that I have to do this again some day. But if you find them helpful, that's great.

Important update

Unfortunately the MacBookPro that I bought second hand turned out to be a dud with some serious hardware flaws that didn't show up until a couple of months after I'd bought it.

I've since purhcased another laptop so I'm not going to be able to maintain this GIST.

I'll leave it here for now in case others want to contribute updates, or clone it. If you feel it's out of date or misleading or a waste of time, let me know in the comments and I'll remove it.

@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@tinabeans
tinabeans / template.html
Last active February 13, 2024 09:18
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active December 29, 2023 00:40
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@oprypin
oprypin / diffcolor.py
Last active October 22, 2023 01:34
Diffs with syntax highlight
import difflib
import pygments
import pygments.lexers
import pygments.formatters
def read_file(fn):
with open(fn) as f:
return f.read()
@jarrodhroberson
jarrodhroberson / CalcMD5Worker.js
Created November 26, 2013 00:09
Reading a File in chunks with the HTML5 FileReader API and calculating MD5 hash codes of the contents with the spark-md5 library in a WebWorker.
importScripts('spark-md5.min.js');
function calcMD5(f) {
var blobSlice = Blob.prototype.slice;
var chunkSize = 2097152;
var chunks = Math.ceil(f.size/chunkSize);
var spark = new SparkMD5.ArrayBuffer();
var currentChunk = 0;
var fr = new FileReader();
@stevenharman
stevenharman / generate_ssl_cert
Created August 16, 2013 14:41
Generate a self-signed cert, update your hosts file, and add it to your OS X Keychain for local SSL success!
#!/usr/bin/env sh
echo "Creating a self-signed certificate..."
openssl req -new -newkey rsa:2048 -sha1 -days 3650 -nodes -x509 -subj "/C=US/ST=Georgia/L=Atlanta/O=BNR/CN=localhost.ssl" -keyout config/server.key -out config/server.crt
if ! grep -q "\blocalhost\.ssl\b" /private/etc/hosts; then
echo "Adding localhost.ssl to your hosts file..."
echo "127.0.0.1 localhost.ssl" | sudo tee -a /private/etc/hosts
fi
@niksumeiko
niksumeiko / mongoose-findOrCreate.js
Last active May 15, 2020 23:53
Mongoose schema static `findOrCreate` method in ES6/7 async/await syntax
import mongoose from 'mongoose';
let schema = new mongoose.Schema({
email: { type: String, required: true, unique: true },
password: { type: String, required: true }
});
schema.statics.findOrCreate = async (conditions, opt_attr) => {
let document = await User.findOne(conditions);
@brentjanderson
brentjanderson / adapter.js
Last active October 23, 2019 19:12
NOTE: Not updated since early 2013 - likely will not work with modern EmberData. Ember.JS, ember-data, and socket.io adapter. Not as primitive as the initial version and it supports object creation/deletion/etc. Does not support bulk updates like the first one just to keep it simple. Does support ember-data revision 11 and does support queries/f…
/*jshint browser:true */
/*global DS:true, io:true, App:true */
(function() {
'use strict';
// Initializer for Models
window.Models = {};
console.warn("Don't pollute the global namespace with Models!");