Skip to content

Instantly share code, notes, and snippets.

Give me back my sanity

One of the many things I do for my group at work is to take care of automating as many things as possible. It usually brings me a lot of satisfaction, mostly because I get a kick out of making people's lives easier.

But sometimes, maybe too often, I end up in drawn-out struggles with machines and programs. And sometimes, these struggles bring me to the edge of despair, so much so that I regularly consider living on a computer-less island growing vegetables for a living.

This is the story of how I had to install Pandoc in a CentOS 6 Docker container. But more generally, this is the story of how I think computing is inherently broken, how programmers (myself included) tend to think that their way is the way, how we're ultimately replicating what most of us think is wrong with society, building upon layers and layers of (best-case scenario) obscure and/or weak foundations.

*I would like to extend my gratitude to Google, StackOverflow, GitHub issues but mostly, the people who make the

@grownseed
grownseed / alpine-docker-setup.sh
Last active February 9, 2023 15:44
Alpine Docker Dev Host Setup
#/bin/sh
#
# The following assumes a default Alpine install using the standard Alpine image
#
# Note: for VirtualBox, you could be tempted to use the `alpine-virt` image,
# however it uses the `virtgrsec` kernel, for which there is no guest additions support
# if required, SSH root password access can be enabled by adding `PermitRootLogin yes`
# to `/etc/ssh/sshd_config`
const neweggUrl = 'https://www.newegg.ca/p/pl?d=rtx+3070&N=100007708&isdeptsrh=1';
function getInStock() {
$.get({
url: neweggUrl,
dataType: 'html',
success: function(data) {
const timestamp = new Date().toLocaleTimeString();
let inStockHtml = '';
$(data).find('div.item-cell').each(function(i, el) {
const isOutOfStock = /OUT OF STOCK/.test($(this).find('.item-info .item-promo').first().text());

Mental Games

It'll come as no surprise to anybody here that the human brain is pretty amazing, and I often wonder how far it can be pushed, or how much control you have over it (or your body by extension). I won't get into any metaphysical considerations here or anything like that, I'd just like to share something I do quite often and hope other people share too.

As far back as I can remember, I've been making up and playing mental games with myself. I didn't really do it consciously until I was maybe about 7 or 8, but as of today I still do pretty much all of them. They generally take no more than a few minutes and I think they're quite an interesting way of exercising your mind and figuring things about how you work.

I'm not sure whether this will come through as absolute lunacy or total stupidity on my part, but this isn't something I've ever seen discussed and I'm genuinely interested in it.

Here are some of my favorites:

{} + [] >>> 0
parseInt({} + []) >>> NaN
!{} > ~{} >>> true
~[] >>> -1
{} + 0 + [] >>> "0"
0 + {} + [] >>> "0[object Object]"
{} + [] + 0 >>> 0
typeof null === 'object' && null !== undefined && null == undefined >>> true
@grownseed
grownseed / centos-docker-setup.sh
Last active December 6, 2016 18:40
CentOS Docker Dev Host Setup
# Allowing symlinks for Windows host/Linux guest VirtualBox:
# - run vbox as administrator
# - run command prompt/PS as administrator and run (from vbox install folder):
# VBoxManage.exe setextradata <VM Name> VBoxInternal2/SharedFoldersEnableSymlinksCreate/<Share Name> 1
# And to check the value stuck:
# VBoxManage.exe getextradata <VM Name> enumerate
# (Note: replace <VM Name> and <Share Name> accordingly)
# add epel repo
yum install -y epel-release
@grownseed
grownseed / concat.sh
Last active December 19, 2015 00:08
Colorado Satellite Photo
# using ImageMagick
montage -mode concatenate -tile 42x52 @tiles.txt out.png
angular.module('magnet.services', []).
config(['$httpProvider', function($httpProvider) {
var interceptor = ['$q', '$rootScope', function($q, $rootScope) {
//handle notifications at root
if (!$rootScope.notifications) {
$rootScope.notifications = [];
$rootScope.removeNotification = function(n) {
$rootScope.notifications = $rootScope.notifications.filter(function(notification) {
return notification != n;
});
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/jade
npm http GET https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/passport
npm http GET https://registry.npmjs.org/passport-google-oauth
npm http GET https://registry.npmjs.org/connect-flash/0.1.0
npm http GET https://registry.npmjs.org/connect-mongo
npm http GET https://registry.npmjs.org/xoauth2
> iconv@2.0.4 install /root/tmp/tmp-25208tcl53wg/build/package/node_modules/mail
parser/node_modules/iconv
> node-gyp rebuild
make: Entering directory `/root/tmp/tmp-25208tcl53wg/build/package/node_modules/
mailparser/node_modules/iconv/build'
CC(target) Release/obj.target/iconv/deps/libiconv/libcharset/lib/localcharset.
o
CC(target) Release/obj.target/iconv/deps/libiconv/lib/iconv.o
CXX(target) Release/obj.target/iconv/src/binding.o