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
@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.

@iamvery
iamvery / Chat.elm
Last active July 11, 2017 15:54
Elm with a React head, cause why not?
port module Chat exposing (main)
-- https://github.com/elm-lang/core/issues/703
import Json.Decode
import WebSocket
port messages : List String -> Cmd msg
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active May 7, 2024 13:38
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@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);
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active May 7, 2024 13:07
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*
@ef4
ef4 / gist:82f37eb5dae4e56467b6
Created June 16, 2014 21:13
Example Application Cache "Bootloader"
(function(){
function useManifest(content){
var tag;
var stylesheets = content.match(/\/css\/.*\.css/g);
for (var i=0; i<stylesheets.length; i++){
tag = document.createElement('link');
tag.href = stylesheets[i];
tag.rel = "stylesheet";
document.getElementsByTagName('head')[0].appendChild(tag);
@iamvery
iamvery / conway.coffee
Created June 3, 2014 18:59
Game of Life WIP with @nybblr
# Live cells with < 2 living neighbors dies to underpop
# > 3 living neighbors dies to overpop
# Otherwise, lives!
#
# Dead cells with exactly 3 living neighbors is born
# . 0 .
# . 0 .
# . 0 .
#
@visnup
visnup / listenOnPortOrSocketFile.js
Last active May 17, 2019 11:57
Listen on a TCP port or a UNIX socket file in node.js. Handle EADDRINUSE for the socket file by deleting it and re-listening.
var fs = require('fs')
, net = require('net')
, http = require('http')
, port = process.env.PORT;
var app = function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
};
@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()
@pouriaalmassi
pouriaalmassi / ios-bootcamp-resources.markdown
Last active January 4, 2016 06:58 — forked from owen-bnr/ios-bootcamp-resources
iOS & OS X Developer Resources

Blogs

  • ASCII WWDC - WWDC session transcripts.
  • NSHipster - Cocoa weekly from Mattt Thompson. Creator of AFNetworking.
  • objc.io - Great resource where each issue consists of a collection posts that all focus on one over arching topic such as testing, Auto Layout, Swift, etc.
  • Mike Ash - Self described as "Wizard without portfolio" Mike Ash is very widely read in the Cocoa community.
  • Bill Bumgarner's Stack Overflow answers - Long time Apple developer who provides well written answers to some of the hairier questions on ObjC and iOS.
  • iOS Dev Weekly - Excellent and widely read weekly that aggregates some of the best writing in the Cocoa developer community.
  • Stable Kernel - Joe Conway, one of the original authors of BNR's Beginning iOS book and former BNR engineer and instructor.
  • [Big Nerd Ran