Skip to content

Instantly share code, notes, and snippets.

View ericandrewlewis's full-sized avatar

Eric Lewis ericandrewlewis

View GitHub Profile

top (the UNIX process inspector) cheat sheet

This is a list of the most helpful keyboard commands I use within top.

The basics

h shows help on interactive commands. Also see the top manual page

q to quit the program.

csrutil disable
bless --folder=/Volumes/EFI --file=/Volumes/EFI/EFI/grub-patched/grubx64.efi --setBoot
bless --mount=/Volumes/EFI --file=/Volumes/EFI/EFI/grub-patched/grubx64.efi --setBoot
@ericandrewlewis
ericandrewlewis / index.js
Created March 2, 2016 03:21
requirebin sketch
console.log('hi')
@ericandrewlewis
ericandrewlewis / index.js
Last active March 2, 2016 03:23
requirebin sketch
var ProseMirror = require("prosemirror").ProseMirror
require("prosemirror/dist/inputrules/autoinput")
require("prosemirror/dist/menu/tooltipmenu")
require("prosemirror/dist/menu/menubar")
var pm = window.pm = new ProseMirror({
place: document.querySelector(".full"),
autoInput: true,
tooltipMenu: {selectedBlockMenu: true},
menuBar: {float: true},
@ericandrewlewis
ericandrewlewis / Dockerfile
Created December 9, 2015 17:33
Varnish 4.0 Dockerfile for VMODs that don't need Varnish source
FROM debian:jessie
RUN apt-get update && \
apt-get install -y varnish
# Dependencies for installing Varnish Modules.
RUN apt-get install -y libvarnishapi-dev curl automake libtool pkg-config make python-docutils
@ericandrewlewis
ericandrewlewis / a.md
Last active October 27, 2020 18:44
The WordPress Customizer

The WordPress Customizer

The WordPress Customizer is an interface for drafting changes to content while previewing the changes before they are saved. This is an alternative to the "save and suprise" model of changing settings without knowing what exactly will happen.

The customizer can be accessed in the admin interface under Appearance > Customize.

A screenshot of the customizer

#19909 is the trac ticket that introduced the Customizer during the 3.4 release cycle.

@ericandrewlewis
ericandrewlewis / 32.asm
Last active November 24, 2020 08:54 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X(get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@ericandrewlewis
ericandrewlewis / index.md
Last active November 24, 2023 14:07
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.

@ericandrewlewis
ericandrewlewis / index.md
Last active February 6, 2019 21:36
PHP Cheat Sheet

PHP is a general purpose programming language with a focus on web programming.

PHP is a dynamically typed language; the type of variables is not known and type-checking occurs at run-time.

function takes_anything($anything) {
	// ...
}

takes_anything( 12345 );
@ericandrewlewis
ericandrewlewis / gist:44410f62d19117454b31
Created August 11, 2015 18:25
Testing extra attachment fields
<?php
function add_attachment_location_field( $form_fields, $post ) {
$field_value = get_post_meta( $post->ID, 'location', true );
$form_fields['location'] = array(
'value' => $field_value ? $field_value : '',
'label' => __( 'Location' ),
'helps' => __( 'Set a location for this attachment' )
);
return $form_fields;
}