Skip to content

Instantly share code, notes, and snippets.

View Alanaktion's full-sized avatar
:shipit:
Working on too many things.

Alan Hardman Alanaktion

:shipit:
Working on too many things.
View GitHub Profile
@Alanaktion
Alanaktion / markov.php
Last active October 17, 2017 03:28
Generate pseudo-random phrases from Markov chains
#!/usr/bin/env php
<?php
if (empty($argv[1]) || $argv[1] == '-h') {
exit ("Usage: markov <input file> [words] [prefix] [minWords]\n");
}
$text = file_get_contents($argv[1]);
$map = map($text);
$words = $argv[2] ?? 20;
$minWords = $argv[4] ?? 10;
@Alanaktion
Alanaktion / gpmdp.css
Created September 12, 2016 17:35
Google Play Music Theme
/* This is a hacky stylesheet for making GPM not so ugly. */
/* Fix GPMDB's playlist nav on dark themes */
#playlist-drawer paper-header-panel[at-top] paper-toolbar:not([style-scope]):not(.style-scope),
#playlist-drawer .autoplaylist-section,
#playlist-drawer #recent-playlists-container {
border-bottom-color: <<BACK_SECONDARY>>;
}
/* Remove Hero image */
@HaleTom
HaleTom / print256colours.sh
Last active May 2, 2024 14:43
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
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document regexp("https?://([^:]+)(:[0-9]+)?/transmission/web/.*") {
* {
background-color: transparent !important;
color: inherit !important;
border-color: var(--border-color) !important;
}
body, div.dialog_container div.dialog_window, .inspector-tab, div#jqContextMenu ul, .ui-widget-content {
@roddds
roddds / gist:a1f42bae598028ac7809
Last active December 8, 2020 22:46 — forked from raddevon/gist:67935d320ee9b726d19d
Adobe tries to strong-arm me into keeping Creative Cloud

To everyone who got here through Twitter or Facebook or Hacker News or whatever: THIS IS NOT ME.

The "Me" in this transcript is @raddevon, who shared his story first on reddit.


List of incompetent jackasses who can't check a source if their lives depended on it:

@raddevon
raddevon / gist:67935d320ee9b726d19d
Created January 17, 2016 16:55
Adobe tries to strong-arm me into keeping Creative Cloud
Chaitra: Hello! Welcome to Adobe Customer Service.
Me: Hello
Chaitra: Hi Devon
Chaitra: I understand that you wish to cancel your subscription, let me help you with that.
Chaitra: May I know the reason for cancellation please?
Me: I'm not using the software enough to justify the cost.
Chaitra: Thank you for the information.
Me: No problem!
Chaitra: I have checked and see that you have Creative Cloud membership (one-year) subscription, which was purchased on 18 Jun 2013.
Chaitra: Before you decide to cancel your subscription, let me give you an offer.
@ygit
ygit / SkipVerification.txt
Last active March 29, 2024 08:27
Skip Verification of Mac Apps
xattr -d com.apple.quarantine /path/to/app/myMacApp.app
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active April 21, 2024 23:48
An Open Letter to Developers Everywhere (About Cryptography)
@Dhertz
Dhertz / Ubuntu_Aerial.md
Last active March 28, 2023 02:06
Quick overview of how to get Apple's new TV screensavers working on most linux systems.

Using Apple’s Aerial Screensavers on Ubuntu After coming across the [Aerial] (https://github.com/JohnCoates/Aerial) screensavers for Mac, and installing them, I decided that I had had enough of the graphics-demos of my Ubuntu Precise system. I hope to provide a simple guide on how to add them to your setup as well.

First, you need to install xscreensaver (for example with aptitude, but your distro should have it):

sudo aptitude install xscreensaver