Skip to content

Instantly share code, notes, and snippets.

@aerouk
aerouk / thumbnail.sh
Created July 25, 2019 16:22
Gets the first jpg in a subdir of the current dir and copies it where the command was executed as the subdir name
#!/bin/sh
for dir in */; do
for file in "$dir"*.jpg; do
cp "$file" "${file%/*}.jpg"
break 1
done
done
@aerouk
aerouk / mods.java
Created May 4, 2017 15:07
[osu!] parse mods from bitwise mod value
public static final Map<String, Integer> osuMods = new LinkedHashMap<String, Integer>();
public OsuListener()
{
osuMods.put("NF", 1);
osuMods.put("EZ", 2);
osuMods.put("HD", 8);
osuMods.put("HR", 16);
osuMods.put("SD", 32);
osuMods.put("DT", 64);
<?php
/**
* Generates a path string for the page header with relevant breadcrumb links.
*
* @param $page string page value of page user is currently accessing (path/format/is/as/such)
* @return string breadcrumb string
*/
function getPathStr($page)
{
{
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"font_face": "Consolas Bold",
"font_options":
[
"gray_antialias"
],
"font_size": 11,
"ignored_packages":
[
@aerouk
aerouk / .htaccess
Created August 5, 2015 19:21
Rewrite to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Keybase proof

I hereby claim:

  • I am aerouk on github.
  • I am aero (https://keybase.io/aero) on keybase.
  • I have a public key whose fingerprint is EFAB 2EAD 353B C6E3 5C83 5677 0A02 EF1C 2306 E7D5

To claim this, I am signing this object:

@aerouk
aerouk / youtube-dlxffmpeg
Created July 30, 2014 17:10
youtube-dl x ffmpeg installer [centos]
# youtube-dl & ffmpeg installer script
# by aerouk
# youtube-dl
sudo curl https://yt-dl.org/downloads/2014.07.30/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl
# ffmpeg
@aerouk
aerouk / README.md
Last active August 29, 2015 14:03
Install YUI Compressor (Java is a prerequisite)

Usage

  1. Ensure Java is installed. yum -y install java7
  2. Put the shell script somewhere you can access and execute it. If you're having trouble executing the file, make sure you chmod the file so you can execute it.
  3. Run the script.
  4. Type the command yc to ensure it installed correctly.

Now you can use the following command to get started:

yc style.css -o style.min.css

@aerouk
aerouk / linkr.php
Created July 10, 2014 16:42
Untested self-hosted linkr script
<?php
/* linkr self-hosted shortener
* © aerouk 2014
*/
$key = "your key";
$err = "/path/to/404"; // public_html/*
if ( ! isset($_GET['url'])) showError($err);
@aerouk
aerouk / README.md
Last active August 29, 2015 14:02
New twitter font everywhere