Skip to content

Instantly share code, notes, and snippets.

View airstrike's full-sized avatar
🎯
Focusing

Andy airstrike

🎯
Focusing
View GitHub Profile
@airstrike
airstrike / split.rs
Created May 6, 2024 19:15
iced_aw split.rs updated for iced master branch (~0.13)
// Modified from iced_aw to work with iced master branch (~0.13). This
// is provided AS IS—not really tested other than the fact that it compiles
// https://github.com/iced-rs/iced_aw/blob/main/src/widgets/split.rs
// https://github.com/iced-rs/iced_aw/blob/main/src/style/split.rs
// MIT License
// Copyright (c) 2020 Kaiden42
// Permission is hereby granted, free of charge, to any person obtaining a copy
@airstrike
airstrike / userstyle.css
Created March 8, 2024 17:43
Hide karma and comment score on HN
@-moz-document domain("news.ycombinator.com") {
/* Hide karma and points on replies */
span.pagetop #karma, span.comhead span.score {
visibility: hidden;
position: relative;
display: inline-block;
height: 10px !important;
overflow: hidden;
}
span.pagetop #karma {

Python Excel Mini Cookbook

Original post at: http://pythonexcels.com/python-excel-mini-cookbook/

To get you started, I’ve illustrated a number of common tasks you can do with Python and Excel. Each program below is a self contained example, just copy it, paste it and run it. A few things to note:

These examples were tested in Excel 2007, they should work fine in earlier versions as well after changing the extension of the file within the wb.SaveAs() statement from .xlsx to .xls If you’re new to this, I recommend typing these examples by hand into IDLE, IPython or the Python interpreter, then watching the effect in Excel as you enter the commands. To make Excel visible add the line excel.Visible = True after the excel =win32.gencache.EnsureDispatch('Excel.Application') line in the script These are simple examples with no error checking. Make sure the output files doesn’t exist before running the script. If the script crashes, it may leave a copy of Excel running in the background. Open the Windows T

@airstrike
airstrike / setup_sqlcl.sh
Last active January 19, 2024 21:47
Installing modern SQLCL shell at NSU
#!/bin/bash
# Navigate to home directory
cd ~
# Create a 'downloads' directory in the home directory
mkdir -p ~/downloads
# Navigate to the 'downloads' directory
cd ~/downloads
@airstrike
airstrike / sqlcl
Created January 19, 2024 18:38
sqlcl bash script
#!/bin/ksh
# Script to initialize necessary variables to run Oracle 12c - J.K. 01/10/16
#
B=`/usr/bin/tput smso`
OB=`/usr/bin/tput rmso`
ORACLE_SID=NSU12
ORACLE_HOME=/u01/app/oracle/product/19.0.0/client_1
@airstrike
airstrike / DropUnusedStyles.bas
Created September 1, 2016 22:55
VBA: Remove unused cell styles from Excel
' Latest version available at:
' http://stackoverflow.com/questions/2449755/too-many-different-cell-formats/8933399#8933399
' Description:
' Borrowed largely from http://www.jkp-ads.com/Articles/styles06.asp
Option Explicit
' Description:
' This is the "driver" for the entire module.
Public Sub DropUnusedStyles()
@airstrike
airstrike / mute-mic.ahk
Last active December 29, 2023 22:08
AutoHotkey | Toggle microphone hotkey script (Windows+U)
;
; AutoHotkey Version: v1.1.22.06
; Language: English
; Platform: Windows 10
; Author: Andy Terra <github.com/airstrike>
;
; Script Function:
; Toggle Microphone Mute -- assumes it is located at WAVE:1, device #2
; Use the SoundCardAnalysis script to figure out where your mic is
; https://www.autohotkey.com/docs/commands/SoundSet.htm#Ex
@airstrike
airstrike / .vimrc
Created August 27, 2023 14:26
vscode .vimrc
" VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set 7 lines to the curors - when moving vertical..
set so=4
set ruler "Always show current position
set cmdheight=1 "The commandbar height
" Set backspace config
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
@airstrike
airstrike / citrix_shenanigans.json
Last active March 6, 2023 20:31 — forked from jdleslie/citrix_ctrl_alt_win.json
Map Apple modifiers (Ctrl, Option, Command) to Windows modifiers (Ctrl, Win, Alt) in Citrix Workspace using Karabiner Elements, with working Alt+Tab and Windows key shortcuts
{
"title": "Citrix Receiver/Workspace shenanigans",
"rules": [
{
"description": "In Citrix, change left_option to Alt key via \"⌘⌥ Command (left)-Option\"",
"manipulators": [
{
"from": {
"key_code": "left_option",
"modifiers": { "optional": [ "any" ] }
@airstrike
airstrike / CycleAccentBackgrounds.bas
Last active January 3, 2023 18:38
Cycle Accent Backgrounds in Excel
' OMNI
' Author: Andre Terra
' Name: CycleAccentBackgrounds
' URL: https://gist.github.com/airstrike/11f58afb9b44c2c81291
' Version: 1.2.1
Sub CycleAccentBackground()
Dim NextColor As Integer
Dim NextColorRGB As Long
Dim ThemeColor As Long