Skip to content

Instantly share code, notes, and snippets.

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());
@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 / 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`
@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
@grownseed
grownseed / open_source_quotes.md
Last active August 29, 2015 14:17
Quotes on Open Source

'Yes,' he said. 'But these things (the solutions to problems in solid geometry such as the duplication of the cube) do not seem to have been discovered yet.' 'There are two reasons for this,' I said. 'Because no city holds these things in honour, they are investigated in a feeble way, since they are difficult; and the investigators need an overseer, since they will not find the solutions without one. First, it is hard to get such an overseer, and second, even if one did, as things are now those who investigate these things would not obey him, because of their arrogance. If however a whole city, which did hold these things in honour, were to oversee them communally, the investigators would be obedient, and when these problems were investigated continually and with eagerness, their solutions would become apparent.'

Plato, The Republic

Take you a glass of water

Make it against the law

See how good the water tastes

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 / gist:6db346a4590ffe632090
Created May 12, 2014 20:18
atom-shell build error
ninja: Entering directory `out/Release'
[15/959] CXX obj/vendor/breakpad/src/client/linux/crash_generation/breakpad_client.crash_generation_client.o
FAILED: /usr/bin/clang++ -MMD -MF obj/vendor/breakpad/src/client/linux/crash_generation/breakpad_client.crash_generation_client.o.d -DCOMPONENT_BUILD -DGURL_DLL -DSKIA_DLL -DNDEBUG -DUSING_V8_SHARED -DWEBKIT_DLL -DUSE_X11 -I../../vendor/breakpad/src -I../../vendor/breakpad/src/client -I../../vendor/breakpad/src/third_party/linux/include -I../../vendor -I../../vendor/breakpad -g -Wno-empty-body -std=gnu++11 -std=gnu++11 -fno-rtti -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -c ../../vendor/breakpad/src/client/linux/crash_generation/crash_generation_client.cc -o obj/vendor/breakpad/src/client/linux/crash_generation/breakpad_client.crash_generation_client.o

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
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;
});