Skip to content

Instantly share code, notes, and snippets.

View ajkaanbal's full-sized avatar
🐷

Ricardo M. Vilchis ajkaanbal

🐷
View GitHub Profile
@ajkaanbal
ajkaanbal / multi-broker-tunnel.sh
Created September 1, 2022 18:13 — forked from valer-cara/multi-broker-tunnel.sh
Kafka on kubernetes: portforward & dnat to all brokers for remote access
#!/bin/bash
# This is a bit hardcoded, but it's meant as a proof of concept.
# used in kubectl get pods when targeting kafka broker pods
KARGS="-n kafka -l release=kafka,app=kafka"
# used in kubectl port-forward (setting the namespace, can be omitted)
KPORTFWD_ARGS="-n kafka"
# port on broker pods to forward
DPORT=9092
@ajkaanbal
ajkaanbal / Makefile
Created March 29, 2019 16:41 — forked from saitoha/Makefile
SIXEL color graphics DEMO (xterm pl#301 and gnuplot)
#
# SIXEL color graphics DEMO
#
# xterm pl#301 with --enable-sixel-graphics option
# gnuplot with --with-bitmap-terminals option
#
# Now the color palette of xterm VT-340 mode is limited to 16.
# If you want to change it to 256, apply the following patch.
# https://gist.github.com/saitoha/7822989/raw/20727b88f0f826bfcb9d644907944b29a456b67f/graphics.c.diff
#
#!/bin/bash
echo "[ build and install vim from source ]"
#
# This script needs "fpm". If you dont have it,
# run "gem install fpm"
#
# You also need to "apt-get install python-setuptools" (otherwise fpm fails)
# cd ~/fs/dev

Keybase proof

I hereby claim:

  • I am ajkaanbal on github.
  • I am ajkaanbal (https://keybase.io/ajkaanbal) on keybase.
  • I have a public key whose fingerprint is CB7A 556F 05CA C687 0335 740A 4957 7F33 1EC9 094F

To claim this, I am signing this object:

def hamming_distance(sequence_1, sequence_2):
"""Count the number of differences between equal length strings sequence_1 and sequence_2"""
diffs = 0
for character_1, character_2 in zip(sequence_1, sequence_2):
if character_1 != character_2:
diffs += 1
return diffs
def most_frequent_pattern(dna, block_size, mistmaches_allowed):
@ajkaanbal
ajkaanbal / ajk.vim
Created April 15, 2016 01:23
lightline color scheme
" =============================================================================
" Filename: autoload/lightline/colorscheme/ajk.vim
" Author: itchyny
" License: MIT License
" Last Change: 2014/05/31 01:04:15.
" =============================================================================
let s:cuicolors = {
\ 'base03': [ '8', '234', 'DarkGray' ],
\ 'base02': [ '0', '235', 'Black' ],
# Fino theme by Max Masnick (http://max.masnick.me)
# Use with a dark background and 256-color terminal!
# Meant for people with RVM and git. Tested only on OS X 10.7.
# You can set your computer name in the ~/.box-name file if you want.
# Borrowing shamelessly from these oh-my-zsh themes:
# bira
# robbyrussell
{
"cadena": "abcde",
"entero": 1,
"decimal": 2.1,
"boleano": true,
"lista_simple": [1,2,3],
"objeto": {
"cadena": "áéióú"
}
}
#!/bin/bash
# This script is the reference implementation of how to start the
# ENSIME server given an ENSIME config file, bootstrapping via sbt[1].
# It is not intended to be portable across operating systems, or
# efficient at caching the results of previous invocations.
# Typically it is best to take the basic concepts of this script and
# to port it to the natural language of the extensible editor that
# intends to support ENSIME.
@ajkaanbal
ajkaanbal / echoHttpRequest.js
Last active August 29, 2015 14:25 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);