Skip to content

Instantly share code, notes, and snippets.

@ManelPin
ManelPin / print256colours.sh
Created December 11, 2023 19:48 — forked from ethan605/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@ManelPin
ManelPin / cli-template.js
Created December 11, 2023 19:47 — forked from ethan605/cli-template.js
Boilerplate to quickly write a CLI tool with Node.js
#!/usr/bin/env node
/**
* A script to do something handy in an easy way
*
* For more info, run:
* $ <cli-name> --help
*/
'use strict'
@ManelPin
ManelPin / instructions.md
Created February 16, 2022 23:08 — forked from openfirmware/instructions.md
QEMU with Mac OS 9 guest *and working audio*

QEMU Mac OS 9 Instructions

Here is a short guide on how to build QEMU to run Mac OS 9 with working audio. These instructions work for MacOS High Sierra as the host OS, although with some tweaking they may run under Linux/Windows. You should be comfortable compiling software from source before attempting.

Clone QEMU fork

Adapted from instructions from Cat_7

You may need to install XCode and/or the XCode command line tools. If you do not have them, then this process may prompt you to install them (MacOS will do that).

@ManelPin
ManelPin / instagram_scrape.php
Created April 26, 2018 04:27 — forked from cosmocatalano/instagram_scrape.php
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}
# Rake task to copy local files to remote server via FTP
# required credentials.yml file, that contains keys:
# server, username, password
require "net/ftp"
require "yaml"
class FTPClient
attr_reader :remote_path