Skip to content

Instantly share code, notes, and snippets.

View nikklassen's full-sized avatar

Nik Klassen nikklassen

View GitHub Profile
@nikklassen
nikklassen / .xprofile
Created October 3, 2018 13:39
Linux Keyboard Remappings
setxkbmap -option 'caps:ctrl_modifier' && xcape -e 'Caps_Lock=Escape' &
spare_modifier="Mode_switch"
xmodmap -e "keycode 24 = $spare_modifier"
xmodmap -e "keycode any = q"
xcape -e "$spare_modifier=q"
# Map q + hjkl to arrow keys
xmodmap -e "keycode 43 = h H 0xFF51 H"
xmodmap -e "keycode 44 = j J 0xFF54 J"
@nikklassen
nikklassen / get_teams.sql
Created April 23, 2018 11:51
Retrieve all champions in a game and the winning team
copy (
with teams as (
select
team_id,
max(case when role = 'TOP' then champion_id else 0 end) as top,
max(case when role = 'JUNGLE' then champion_id else 0 end) as jungle,
max(case when role = 'MIDDLE' then champion_id else 0 end) as mid,
max(case when role = 'DUO_SUPPORT' then champion_id else 0 end) as support,
max(case when role = 'DUO_CARRY' then champion_id else 0 end) as adc
-- string_agg(

Keybase proof

I hereby claim:

  • I am nikklassen on github.
  • I am nik_klassen (https://keybase.io/nik_klassen) on keybase.
  • I have a public key ASC8a14ses-Gwmj2AIqu-j_NZz32Bx4U4C94LzRivTRePwo

To claim this, I am signing this object:

@nikklassen
nikklassen / assembly_tester.rb
Last active December 24, 2015 15:19
Assembly tester
@tests = Hash.new
@groups = Hash.new(Array.new())
def parse_xxd xxd_output
temp_array = []
xxd_output.split("\n").each do |line|
temp = line.match(/((\d|[a-f]){4} )+/).to_s
temp_array << temp[/.*(?= $)/]
end
temp_array.join("\n")