Skip to content

Instantly share code, notes, and snippets.

View airstrike's full-sized avatar
🎯
Focusing

Andy airstrike

🎯
Focusing
View GitHub Profile
@airstrike
airstrike / nginx.conf
Created February 24, 2014 22:13
Sample Nginx.conf for Trac
server {
listen 10.9.8.7:443;
server_name trac.example;
ssl on;
ssl_certificate /etc/ssl/trac.example.crt;
ssl_certificate_key /etc/ssl/trac.example.key;
ssl_session_timeout 5m;
@airstrike
airstrike / htpasswd-digest.py
Created February 25, 2014 13:11
Create htpasswd-like digest without Apache
from optparse import OptionParser
# The md5 module is deprecated in Python 2.5
try:
from hashlib import md5
except ImportError:
from md5 import md5
realm = 'trac'
# build the options
usage = "usage: %prog [options]"
#!/usr/bin/bash
#
# ANSI color scheme script featuring Space Invaders
#
# Original: http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
# Modified by lolilolicon
#
f=3 b=4
for j in f b; do
#!/bin/bash
# ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
# colortest (tests the colors of your terminal using ANSI codes)
#
# written by: Josh D. Dotson, Oct 9th, 2011
# License as follows:
# Copyright (c) 2011 Josh D. Dotson
#
# YOU ARE HEREBY GRANTED PERMISSION TO USE THIS HOW YOU SEE FIT, AS PUBLIC DOMAIN.
# IF YOUR COUNTRY, STATE OR TOWNSHIP DOES NOT PERMIT SUCH, IT IS LICENSED SIMILAR TO
@echo off
IF "%PROJECT%" == "" (
prompt $e[0;32;40m$p$e[0;32m:$s$e[39m
) ELSE (
prompt $e[0;34;40m$c%PROJECT%$f$s$e[0;32;40m$p$e[0;32m:$s$e[39m
)
@echo on
@airstrike
airstrike / StyleKill.bas
Created July 3, 2014 17:59
Excel: Delete every custom cell style
Private Sub StyleKill()
Dim styT As Style
Dim intRet As Integer
For Each styT In ActiveWorkbook.Styles
On Error Resume Next
If Not styT.BuiltIn Then styT.Delete
On Error GoTo 0
Next styT
End Sub
@airstrike
airstrike / AutoFit.bas
Created December 30, 2014 04:31
Excel: Autofit current column and make selected columns the same size as the largest of them
Option Explicit
Sub AutoFit()
Dim Sht As Worksheet
Set Sht = ActiveSheet
With Selection
.EntireColumn.AutoFit
End With
Type StoreRangeInfo
'TODO: Store workbook name, file name.
Columns() As Variant
Widths() As Variant
End Type
Public AutoFitUndoData As StoreRangeInfo
Private Sub PrepareAutoFitUndo(Rng As Range)
ReDim AutoFitUndoData.Columns(1 To Rng.Columns.Count)
@airstrike
airstrike / DeleteUnusedCustomNumberFormats.bas
Last active August 29, 2015 14:24
DeleteUnusedCustomNumberFormats
'Credits to Leo Heuser, as posted by Ivan Moala at http://www.mrexcel.com/archive/VBA/5160.html
Sub DeleteUnusedCustomNumberFormats()
Dim Buffer As Object
Dim Sh As Object
Dim SaveFormat As Variant
Dim fFormat As Variant
Dim nFormat() As Variant
Dim xFormat As Long
Dim Counter As Long
Dim Counter1 As Long
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.