Skip to content

Instantly share code, notes, and snippets.

@klazuka
klazuka / notes.txt
Created March 1, 2019 00:17
Notes on the IntelliJ action system
WARNING: these are raw notes. I do not work for JetBrains. This is just meant to give a rough overview.
DataManager
- convert a Swing component into a DataContext (which can then be queried)
- handles the tree walk to find the focused Swing component
- you can call `registerDataProvider()` to register yourself as a data provider for the action system
DataContext

Keybase proof

I hereby claim:

  • I am klazuka on github.
  • I am klazuka (https://keybase.io/klazuka) on keybase.
  • I have a public key ASAIkME8bJygt-8l2YV-ONJPpL3Qx8cSwBHZhxipKX1bPQo

To claim this, I am signing this object:

@klazuka
klazuka / install-gpu-azure.sh
Last active January 11, 2018 17:57
Setup an Azure VM with GPU hardware based on Fast.AI configuration
# based on https://raw.githubusercontent.com/fastai/courses/master/setup/install-gpu-azure.sh
# modified January 2018 to fix various issues found in the original install script
# assumes that you installed your Azure VM using the Deep Learning Virtual Machine template
# TODO why did the original script install Anaconda? Maybe the Azure VM didn't used to come with it?
sudo apt-get update && sudo apt-get --assume-yes upgrade
sudo apt-get --assume-yes install tmux build-essential gcc g++ make binutils
sudo apt-get --assume-yes install software-properties-common
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.44-1_amd64.deb
@klazuka
klazuka / Client.elm
Created May 4, 2017 19:10 — forked from eriklott/Client.elm
Elm Backend Client
module YourAPIClient exposing (Config, otherFunctions)
import Http
import Json.Decode as Decode
import Json.Encode as Encode
-- Config
@klazuka
klazuka / keybase.md
Created December 7, 2016 21:02
keybase.md

Keybase proof

I hereby claim:

  • I am klazuka on github.
  • I am klazuka (https://keybase.io/klazuka) on keybase.
  • I have a public key whose fingerprint is A333 39C2 3C11 4D44 0160 AA2F 845C 70A7 DD1F A59C

To claim this, I am signing this object:

@klazuka
klazuka / fish_title.fish
Created September 26, 2015 16:40
fish shell: custom terminal title using current git repo name
# Change the terminal title automatically based on current process / working-directory
#
# The main improvement over the default 'fish_title' behavior
# is that I use the name of the current git repo, if any, as
# opposed to the raw working-directory
function fish_title
set -l command (echo $_)
if test $command = "fish"
# we are sitting at the fish prompt
@klazuka
klazuka / .bashrc
Created July 18, 2013 01:00
portions of my .bashrc relevant to git
function mk_prompt
{
# script to visually list terminal color codes:
# http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
local GRAY="\[\033[0;37m\]"
local BOLD_GRAY="\[\033[1;37m\]"
local GREEN="\[\033[0;32m\]"
local BOLD_GREEN="\[\033[1;32m\]"
local CYAN="\[\033[0;36m\]"
local BOLD_CYAN="\[\033[1;36m\]"
@klazuka
klazuka / gist:5470739
Created April 26, 2013 21:57
ugliest line of Objective-C ever??
_guid = [[NSUUID UUID] UUIDString];
@klazuka
klazuka / TwoColumnTextArea.h
Created April 26, 2013 21:16
iOS: basic 2-column text layout
//
// TwoColumnTextArea.h
// TastingRoom
//
// Created by Keith Lazuka on 4/26/13.
// Copyright (c) 2013 Keith Lazuka. All rights reserved.
//
#import <UIKit/UIKit.h>
@klazuka
klazuka / gist:5439717
Last active December 16, 2015 13:09
Workaround Apple's limited API for obtaining the "full resolution" cropped & rotated photo. Uses CoreImage on iOS 6+. Punts on iOS <6
static CIImage* ApplyFiltersToImage(NSArray *filters, CIImage *inputImage)
{
CIImage *img = inputImage;
for (CIFilter *filter in filters)
{
[filter setValue:img forKey:kCIInputImageKey];
img = filter.outputImage;
}
return img;
}