Skip to content

Instantly share code, notes, and snippets.

Joey Schoblaska joeyschoblaska

Block or report user

Report or block joeyschoblaska

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View note.rb
#!/usr/bin/env ruby
require "rubygems"
require "fuzzy_match"
def find_match(str, opts = {})
notes = Dir["/Users/joey/Dropbox/notes/**/*", "/home/joey/Dropbox/notes/**/*"].select { |n| n =~ /\./ }
FuzzyMatch.new(notes, opts).find(str)
end
@joeyschoblaska
joeyschoblaska / tm
Last active Jan 9, 2018
Bash script to either create or attach to a named tmux session with the given working directory.
View tm
#!/bin/bash
if [ "$1" != "" ]; then
cd $1
fi
DIR_NAME=${PWD##*/}
tmux has-session -t $DIR_NAME 2>/dev/null
if [ $? -eq 1 ]
View webpack.config.js
var debug = process.env.NODE_ENV !== "production";
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: [
"./js/main.js",
"./styles/application.scss",
View karabiner.xml
<?xml version="1.0"?>
<!--
Tap CAPS for ESC, hold CAPS + hjkl for Vim movement.
Open "System Preferences > Keyboard > Modifier Keys..." and change caps lock configuration to "No Action"
Use Seil to remap caps to F19 (80)
-->
<root>
View spec_age.rb
require "date"
specs = []
def get_indentation(line)
line.match(/^(\s*)/)[1].length
end
File.open(ENV["FILE"]) do |file|
spec = nil
View eggnog.md
  • 2 eggs
  • 3 oz (by volume) baker's sugar
  • 1/2 tsp nutmeg
  • 4 oz bourbon, brandy or rum
  • 6 oz whole milk
  • 4 oz heavy cream

Whip eggs and sugar, then add remaining ingredients. Garnish with more nutmeg.

View openings.csv
ECO Count Name PGN
A40 2,160,508 Queen Pawn Opening 1.d4
B00 1,398,214 King's Pawn 1.e4
C20 1,050,507 King Pawn Game 1.e4 e5
B20 955,201 Sicilian Defense 1.e4 c5
D00 661,940 Queen Pawn Game 1.d4 d5
A45 651,186 Indian Game 1.d4 Nf6
C44 571,079 King's Knight Opening: Normal Variation 1.e4 e5 2.Nf3 Nc6
C40 532,194 King's Knight Opening 1.e4 e5 2.Nf3
B50 517,282 Sicilian Defense: Modern Variations 1.e4 c5 2.Nf3 d6
@joeyschoblaska
joeyschoblaska / queries.rb
Last active Aug 29, 2015
tracking down which lines of code are executing mysql queries
View queries.rb
$queries = 0
$locations = Hash.new { |h, k| h[k] = 0 }
class ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter
def execute_with_tracking(sql, name = nil)
$queries += 1
caller.select{ |c| c =~ /app/ }.each{ |c| $locations[c] += 1 }
execute_without_tracking(sql, name)
end
View gist:98feb746dc49c01dcc04

start with an opening explorer. have a way to comment on each position, maybe even to up/downvote comments so that a user can give a good explanation of what is going on in the position and have it surface to the top. solicit comments for each move and position, prioritizing the most common-occuring ones. good, approachable explanations like this: http://www.eudesign.com/chessops/epin-01b.htm

let players upload their games. analyze them, show blunders, rating changes. nice commenting system to make analysis easier. take tactics from games and put them into a tactics trainer pool. use this to figure out how difficult each tactic is and to get users to classify them. use this info to help players understand what tactics they're missing in their games. automatically build their opening book based on what they play, and help them find holes

when using opening explorer, allow user to choose different game sets. ex: I want to know what people rated 1200-1400 play against this defense

take the chess position trai

View gist:636eef7c9f85f1c68425
AMERICAN
4 Hands slngle speed
4 H£Dl1.S'E!SWlD_l] Ca, 5L Llmls, M0
541; MW
Allagash whlte
Allagasa Ersmng company, ponlanlz ME
5241: MW
You can’t perform that action at this time.