Skip to content

Instantly share code, notes, and snippets.

View possibilities's full-sized avatar

Mike Bannister possibilities

View GitHub Profile
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
python3 is already the newest version (3.9.2-3).
python3-venv is already the newest version (3.9.2-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Cloning into '/home/mike/src/qutebrowser'...
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@possibilities
possibilities / headlessvm.md
Last active June 10, 2021 23:59 — forked from elasticskyx/headlessvm.md
Run VirtualBox Virtual Machines in Headless Mode #virtualbox #windows #vm

Setup a Headless Virtual Machine on Windows using Oracle VirtualBox

If you are concerned with having many windows open when running several virtual machines on your Windows server or workstation, then have them run headless using VirtualBox commandline tools. Additionally, you can manage these VM's using RDP (Mircrosoft Terminal Server Connection - mstsc.exe) or SSH access (if enabled)

Install VirtualBox and Extension Packs

  • Download the latest version and install of [Oracle VirtualBox] [vbox]
  • Download the [VirtualBox Extension Pack] [vbox] and install for the same version
@possibilities
possibilities / meteor-async.md
Created August 23, 2012 22:53
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

#!/bin/sh
set -e
cd /provision
/provision/provision.system.sh
/bin/su -c '/provision/provision.user.sh' mike
#!/bin/bash
set -e
date >> ./doooof.txt
#!/bin/bash
set -e
date >> ./doooof.txt
@possibilities
possibilities / scrollTo.js
Created April 28, 2017 21:04 — forked from james2doyle/scrollTo.js
a native scrollTo function in javascript that uses requestAnimationFrame and easing for animation
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};

Seven Principles of Meteor

  • Data on the Wire. Don't send HTML over the network. Send data and let the client decide how to render it.

  • One Language. Write both the client and the server parts of your interface in JavaScript.

  • Database Everywhere. Use the same transparent API to access your database from the client or the server.

  • Latency Compensation. On the client, use prefetching and model simulation to make it look like you have a zero-latency connection to the database.