Skip to content

Instantly share code, notes, and snippets.

View n-at-han-k's full-sized avatar
🚀

Nathan Kidd n-at-han-k

🚀
View GitHub Profile
@n-at-han-k
n-at-han-k / rakefile_extract_fixtures.rb
Created November 15, 2025 15:54 — forked from deepak/rakefile_extract_fixtures.rb
generate fixtures from actual data in database
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
require 'deferrable_gratification'
class Promise
def initialize
@df = EM::DefaultDeferrable.new
DG.enhance! EM::DefaultDeferrable
end
def done(&block)
tap { @df.callback(&block) }
@n-at-han-k
n-at-han-k / main.rb
Created November 13, 2025 04:31 — forked from takahashim/main.rb
require 'rubycocoa'
##### begin from drb/invokemethod.rb
module DRb
class DRbServer
module InvokeMethod18Mixin
def block_yield(x)
if x.size == 1 && x[0].class == Array
x[0] = DRbArray.new(x[0])
end

Hey

The journey from the first simple bots to superhuman AI like Libratus and Pluribus is a fascinating 27-year story of academic rivalries, commercial scandals, and massive algorithmic breakthroughs. It's a perfect case study in AI for imperfect information games.

I've written up a little history, from the first academic attempts in 1998 to the modern "GTO Solvers." Grab a coffee, this is a long one.


The History of Online Poker Bots: From Loki's Rules to CFR's Divinity

@n-at-han-k
n-at-han-k / contact.rb
Created May 6, 2025 00:21 — forked from endymion/contact.rb
Example of integrating a Ruby on Rails app with Zapier using the REST hooks pattern. With support for triggering the REST hooks from Resque background jobs.
class Contact < ActiveRecord::Base
...
def after_create
if Hook.hooks_exist?('new_contact', self)
Resque.enqueue(Hook, self.class.name, self.id)
# To trigger directly without Resque: Hook.trigger('new_contact', self)
end
end
@n-at-han-k
n-at-han-k / yardoc_cheatsheet.md
Created April 22, 2025 12:15 — forked from phansch/yardoc_cheatsheet.md
Improved YARD cheatsheet
@n-at-han-k
n-at-han-k / battery.sh
Created April 22, 2025 03:26
Check battery on ubuntu
#!/bin/bash
upower -i $(upower -e | grep -i BAT)
@n-at-han-k
n-at-han-k / sexkbmap.sh
Created April 11, 2025 07:59
sexkbmap for Macbook Air 2015 GB (United Kingdom)
#!/bin/bash
setxkbmap gb mac
@n-at-han-k
n-at-han-k / vcf_to_csv.rb
Created March 30, 2025 10:16
Extract and convert data from VCF Vcards to CSV in Ruby
#!/usr/bin/env ruby
#require 'pp'
require 'vpim/vcard'
require 'csv'
COLUMN_ORDER = %w[
given_name
landline
mobile
@n-at-han-k
n-at-han-k / keyboard_backlight.sh
Created March 10, 2025 23:12
Script to enable keyboard backlight on Apple Macbook Air (Intel)
#!/bin/bash
set +o noclobber
modprobe applesmc
echo 10 > /sys/class/leds/smc::kbd_backlight/brightness
set -o noclobber