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 / blurImg.php
Created December 15, 2016 23:33
Updated blur.php for PHP's gd library with full RGB
<?php
/**
* Blur values in both directions
* @param resource $src
* @param integer $radius
* @return resource
*/
function blur($src, $radius) {
return bVert(bHoriz($src, $radius), $radius);
@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 */
@Alanaktion
Alanaktion / arch-setup.sh
Created March 7, 2017 23:56
Antergos Xfce setup
#!/bin/bash
# This script is meant to be run on a fresh install of Antergos with Xfce
function prompt() {
echo -n "$1 [y/n] "
read prompt_response
if [ $prompt_response == 'y' ]; then
return 0
else
return 1
@Alanaktion
Alanaktion / settings.json
Created May 3, 2017 16:40
Micro editor settings
{
"autoclose": true,
"autoindent": true,
"autosave": false,
"colorcolumn": 80,
"colorscheme": "monokai",
"cursorline": true,
"eofnewline": true,
"ignorecase": false,
"indentchar": " ",
@Alanaktion
Alanaktion / xfce2gnome.sh
Last active June 16, 2017 20:27
Convert Antergos Xfce installation to Gnome Shell
# This will convert an Antergos Xfce installation to Gnome
# LightDM will be replaced with GDM
# Don't continue on errors, since we can really screw up a system if we do
set -e
# Common packages
# evince
# file-roller
# gnome-calculator
@Alanaktion
Alanaktion / gnome2xfce.sh
Last active June 16, 2017 20:42
Convert Antergos Gnome to Xfce (assuming gdm)
# This will convert an Antergos Gnome installation to Xfce
# GDM will be replaced with LightDM with the GTK greeter
# It keeps a few Gnome utilities around and installs Xfce4's WhiskerMenu plugin
# Don't continue on errors, since we can really screw up a system if we do
set -e
# Kill existing sessions
sudo systemctl stop gdm
@Alanaktion
Alanaktion / ticker.sh
Created June 27, 2017 22:55
Cryptocurrency exchange rate ticker
#!/bin/bash
btc=$(curl -s https://api.coinbase.com/v2/prices/BTC-USD/buy | json data.amount)
eth=$(curl -s https://api.coinbase.com/v2/prices/ETH-USD/buy | json data.amount)
ltc=$(curl -s https://api.coinbase.com/v2/prices/LTC-USD/buy | json data.amount)
echo 'BTC $'$btc' ETH $'$eth' LTC $'$ltc
@Alanaktion
Alanaktion / opensql-pro.desktop
Last active August 2, 2017 22:53
Desktop file for PyGObject app
[Desktop Entry]
Version=1.0
Type=Application
Name=OpenSQL Pro
Comment=A powerfully simple database client
Icon=office-database
Exec=python .
Path=/home/alan/GitHub/opensql-pro
Categories=Development;
StartupNotify=true
@Alanaktion
Alanaktion / elastic.php
Created September 6, 2017 05:54
Phproject/Elasticsearch test integration
<?php
/**
* Elasticsearch importer and test client
*/
require_once 'vendor/autoload.php';
$f3 = Base::instance();
$f3->mset(array(
'UI' => 'app/view/',
@Alanaktion
Alanaktion / f3ws-chat.php
Created October 13, 2017 20:27
Minimal chat server on F3 WS
<?php
require_once 'vendor/autoload.php';
$ws = new \CLI\WS('localhost:8033');
$nicks = [];
// Handle agent connections
$ws->on('connect', function($agent) {
echo sprintf("Client %s connected\n", $agent->id());
print_r($agent->headers());