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 / blur.php
Last active June 8, 2018 20:27
Messing with basic blurs in PHP
<?php
/**
* Output a map
*
* @param array $map
* @param bool $int Round output to integer values
*/
function out(array $map, $int = true) {
foreach($map as $r) {
@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 / compton.conf
Last active June 28, 2021 18:24
Compton configuration
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
@Alanaktion
Alanaktion / osx-defaults.sh
Created April 7, 2016 16:44
OS X Defaults
# I have issues with OS X's defaults. Luckily, most are easy to change.
# This is heavily based on saetia's gist: https://gist.github.com/saetia/1623487
# Disable autocomplete, which effectively disables that really stupid Escape key autocomplete handler
defaults write -g NSUseSpellCheckerForCompletions -bool false
# Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Expand save panel by default
@Alanaktion
Alanaktion / pacman.md
Last active April 21, 2020 14:49
Useful pacman commands and packages

Basic usage

pacman -S <package> # Install a package
pacman -Sy # Update package list
pacman -Su # Update installed packages
pacman -Ss <query> # Search packages
pacman -R <package> # Remove a package
pacman -Rs <package> # Remove a package and it's unneeded dependencies
@Alanaktion
Alanaktion / prompt.sh
Created January 5, 2016 23:57
A basic prompt function for bash scripts
#!/bin/bash
function prompt() {
echo -n $1
echo -n " [y/n] "
read prompt_response
if [ $prompt_response == 'y' ]; then
return 0
else
return 1
@Alanaktion
Alanaktion / deb-setup.sh
Last active November 9, 2017 21:02
A perfect Xubuntu setup
#!/bin/bash
# This script is designed to run on Xubuntu 14.04, but should work on
# most Ubuntu and Debian-based distros
##################
# Define globals #
##################
SETUPNAME="Alan's Xubuntu Setup"
DISTRO=`lsb_release -c | awk '{ print $NF }'`
@Alanaktion
Alanaktion / term.php
Last active December 2, 2015 21:40
Terminal window helper functions
<?php
/**
* Get terminal window size in characters
* @return array
*/
function getWindowSize() {
return array(exec('tput cols'), exec('tput lines'));
}
@Alanaktion
Alanaktion / update-phproject.sh
Created November 24, 2015 22:45
Updates a Phproject instance and it's plugins via git
#!/bin/bash
PROJPATH="/var/www/phproject"
cd $PROJPATH
/usr/bin/git pull
cd $PROJPATH/app/plugin
for i in */; do
echo "Updating $i ..."
cd $i
@Alanaktion
Alanaktion / mkdeb.sh
Last active November 9, 2015 18:12
Packages rbrito/mediterranean-gtk-themes as a .deb archive
#!/bin/bash
mkdir -p mediterranean-gtk-themes/usr/share/ && cd $_
git clone --depth=1 https://github.com/rbrito/mediterranean-gtk-themes.git themes
cd themes
VER=$(git rev-parse --short=12 HEAD)
rm -rf .git
rm LICENSE README.md
cd ../../..
mkdir DEBIAN
cat >DEBIAN/control <<EOL