Skip to content

Instantly share code, notes, and snippets.

View eggbean's full-sized avatar

Jason Gomez eggbean

  • London, United Kingdom
View GitHub Profile
@dryan
dryan / pngoptimizer.py
Created September 21, 2009 20:36
Python script for batch running optipng
#!/usr/bin/env python
# requires optipng library
import os,optparse
parser = optparse.OptionParser()
parser.add_option('--file', '-f', default=False, help="The file to optimize. Omit to optimize all pngs in the current directory.")
parser.add_option('--optimization', '-o', default=7, help="The optimatization level to run. Defaults to 7.")
options,args = parser.parse_args()
@claylo
claylo / cf-invalidate.php
Created June 5, 2011 17:09
How to invalidate items in AWS CloudFront
<?php
/**
* Super-simple AWS CloudFront Invalidation Script
*
* Steps:
* 1. Set your AWS access_key
* 2. Set your AWS secret_key
* 3. Set your CloudFront Distribution ID
* 4. Define the batch of paths to invalidate
* 5. Run it on the command-line with: php cf-invalidate.php
@yevgenko
yevgenko / pastebin.sh
Created February 11, 2012 19:02
PASTEBIN.COM BASH SCRIPT – PASTE DIRECTLY FROM YOUR TERMINAL
#!/bin/bash
# Paste at Pastebin.com using command line (browsers are slow, right?)
# coder : Anil Dewani
# date : Novemeber 7, 2010
#help function
howto()
{
echo "\
Pastebin.com Bash Script \
@Munter
Munter / optimizeimages.sh
Created May 2, 2012 12:44
Shell script to recursively optimize all image in the current directory. WARNING: THIS OVERWRITES YOUR ORIGINALS AND REMOVES METADATA!
#!/bin/sh
set -o errexit
PNGS=`find . -iname "*.png"`
JPGS=`find . -iname "*.jpg"`
TMP1="_TMP1.PNG"
TMP2="_TMP2.PNG"
echo "Optimizing PNG"
for PNG in ${PNGS}
@isGabe
isGabe / functions.php
Created September 19, 2012 18:11
WordPress: Auto versioning of CSS/JS files #snippet #WordPress
/*
Auto-version CSS & JS files, allowing for cache busting when these files are changed.
Place in functions.php or wherever you are enqueueing your scripts & styles
Avoids using query strings which prevent proxy caching
Adjust paths based on your theme setup. These paths work with Bones theme
*/
@dkasak
dkasak / xdg.vim
Last active May 4, 2024 05:45 — forked from kaleb/XDG.vim
vim XDG Base Directory support
" XDG Environment For VIM
" =======================
"
" References
" ----------
"
" - http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
" - http://tlvince.com/vim-respect-xdg
" - https://gist.github.com/kaleb/3885679 (the original version)
"
@flynx
flynx / Windows10-PrtSc-to-App.reg
Created April 12, 2016 04:31
Remap PrintScreen button to Application (menu) button - useful for modern Lenovo ThinkPad keyboards without an Application button...
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,5d,e0,37,e0,00,00,00,00
@romainl
romainl / colorscheme-override.md
Last active April 27, 2024 15:36
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Generalities first

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.
@TaipanRex
TaipanRex / Windows-app-Ranger.md
Last active November 16, 2023 10:05
How to launch Windows applications from Ranger in Windows Subsystem for Linux (WSL)

Make sure you have WSL with the Windows 10 Fall Creators Update installed. Ranger uses rifle as a file handler and you need its config file, rifle.conf. If you dont have it (should be in ~/.config/ranger/rifle.conf), run the command ranger --copy-config=rifle, then edit the resulting file.

To run Windows applications from Ranger, we will use cmd.exe /C start "" <file>, which works after the Fall Creators Update. The problem is that Ranger will feed in file paths using Unix pathing, but start expects Windows pathing. We will solve this by using sed to translate the path.

Add below code to your rifle.conf and you will be able to run Windows applications for the chosen file extensions.

@mikepruett3
mikepruett3 / shell-setup.ps1
Last active May 9, 2024 17:09
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018