Skip to content

Instantly share code, notes, and snippets.

View nchelluri's full-sized avatar

Narsimham Chelluri nchelluri

  • Halifax, NS
View GitHub Profile

A chess memory

I used to play chess when I was a kid. I learned the rules at home from my parents or my brother, and when I was maybe 8 years old I started attending a sort of chess workshop at, I believe, the library down on Spring Garden (later, the workshop moved to the Chocolate Lake Rec Center). The guy who ran the workshop was very friendly and taught us about openings, the middlegame, and the endgame, and we played against each other and worked on solving some problems ("Given this position, black has mate in two. What are the moves?"). It was a lot of fun.

I was pretty unskilled at chess; through those years I played in a number of junior tournaments (and, I think, maybe even a few open tournaments), I would sometimes play at Bluenose Chess Club, and of course I attended the workshops. But my CFC rating never broke 1000 (which is quite low - though my "active" [shorter game duration] rating just barely broke 1200, once). I lost most of the time no matter who I was playing.

One of the kids at th

@nchelluri
nchelluri / TidyThis.pm
Created July 10, 2021 11:43
Perl Tidy bug: `Use of uninitialized value $Ktoken_vars in numeric eq (==) at /opt/perl5.32.1/lib/site_perl/5.32.1/Perl/Tidy/Formatter.pm line 5133.`
#<<<
(
'asdf',
{ some_key => 'some string' },
);

Notes on A Philosophy of Software Design, by John Ousterhout

Chapter 1 - Introduction (It's All About Complexity)

All programming requires is a creative mind and the ability to organize your thoughts. If you can visualize a system, you can probably implement it in a computer program.

This means that the greatest limitation in writing software is our ability to understand the systems we are creating. As a program evolves and acquires more features, it becomes complicated, with subtle dependencies between its components. Over time, complexity accumulates, and it becomes harder and harder for programmers to keep all of the relevant factors in their minds as they modify the system. [...] Complexity increases inevitably over the life of any program.

Good development tools can help us deal with complexity, and many great tools have been created over the last several decades. But there is a limit to what we can do with tools alone. If we want to make it easier to write software, so that we can build

package main
import (
"fmt"
"sync"
)
func gen(nums ...int) <-chan int {
out := make(chan int)
go func() {
[
{
"Database": "GeoLite2-Country.mmdb",
"Records": [
{
"Network": "56.0.0.1/8",
"Record": {
"continent": {
"code": "NA",
"geoname_id": 6255149,
I have come from a Rails background where webapps use seven "verbs" for routing.
Method Path Name Action
GET /resources resources_url Resources#index (listing)
POST /resources " Resource#create (INSERT)
GET /resources/new new_resource_url Resource#new (form)
GET /resources/:id resource_url(id) Resource#show (SELECT)
PUT /resources/:id " Resource#update (UPDATE)
DELETE /resources/:id " Resource#destroy (DELETE)
GET /resources/:id/edit edit_resource_url(id) Resource#edit (form)
@nchelluri
nchelluri / gist:3694eddf8e5280bdfe63e97358660c38
Last active June 19, 2017 15:14
Single character multiple byte emoji
👨🏼‍💻
@nchelluri
nchelluri / word-soup-hack.pl
Created June 13, 2017 14:59
Finds all words that can be made with a given string of letters
#!/usr/bin/env perl
use Modern::Perl '2015';
use autodie;
use experimental 'signatures';
use List::MoreUtils qw(uniq);
unless (@ARGV == 1) {
say "usage: $0 letters";
default: &default
adapter: mysql2
pool: 5
encoding: utf8mb4
charset: utf8mb4
collation: utf8mb4_unicode_ci
socket: /tmp/mysql.sock
development:
<<: *default
@nchelluri
nchelluri / gist:c8b5c565230730800fdac3e9779c810d
Last active August 12, 2016 15:45
Mailer Exceptions not showing
Using Rails 5. Why won't my Mailer show exceptions in the log?
- ActionMailer Config from development.rb:
[...]
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.logger = Logger.new($stdout) # this is experimental, doesn't seem to make a difference
config.action_mailer.perform_caching = false