Skip to content

Instantly share code, notes, and snippets.

View kalevivt's full-sized avatar

Kalevi Vázquez Tuisku kalevivt

View GitHub Profile
@kalevivt
kalevivt / .gitconfig
Created February 26, 2019 12:24 — forked from nickytonline/.gitconfig
Git Aliases
alias.a add .
alias.aliases config --get-regexp alias
alias.bi bisect
alias.ci commit -m
alias.co checkout
alias.colast checkout -
alias.db branch -D
alias.laf fsck --lost-found
alias.last log -1 HEAD
alias.nb checkout -b
@kalevivt
kalevivt / jinja2_file_less.py
Created August 16, 2018 21:13 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind V split-window -h
bind H split-window
set -g mouse on
set -g default-terminal "screen-256color"
setw -g status-style fg=white,bg=black
setw -g window-status-style fg=cyan,bg=black
setw -g window-status-current-style fg=white,bold,bg=red
setw -g monitor-activity on
@kalevivt
kalevivt / udp_ipv6_client.py
Created June 20, 2018 15:55 — forked from tuxmartin/udp_ipv6_client.py
Python UDP IPv6 client & server
import socket
UDP_IP = "::1" # localhost
UDP_PORT = 5005
MESSAGE = "Hello, World!"
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", MESSAGE
@kalevivt
kalevivt / dask_perf.png
Created March 9, 2018 22:38 — forked from devin-petersohn/dask_perf.png
Pandas on Ray Introduction
dask_perf.png
@kalevivt
kalevivt / 0_reuse_code.js
Created November 9, 2015 16:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kalevivt
kalevivt / flask_app.py
Last active August 29, 2015 14:27
Sample flask app to show simple csv data fetched from the web.
from flask import Flask
from flask import render_template
import csv
import urllib.request
app = Flask(__name__)
@app.route('/')
def hello_world():
# Copyright (c) 2014 Justin W. Smith
# Don't be evil!
require 'base64'
require 'socket'
require 'optparse'
options = {port: 443}
optparser = OptionParser.new do |opts|
#!/usr/bin/env python
import unittest
class Node:
def __init__(self, key, data):
self.key = key
self.data = data
self.left = None
self.right = None
@kalevivt
kalevivt / post.rb
Created June 28, 2013 21:15 — forked from matenia/post.rb
class Post < ActiveRecord::Base
# for SO: http://stackoverflow.com/questions/10481389/friendly-id-with-two-parameters
# EXAMPLE ASSUMES YOU ARE USING FRIENDLYID 4.X
# AND THAT YOU HAVE A SLUG:STRING COLUMN ON THE MODEL
# ...
extend FriendlyId
friendly_id :generate_custom_slug, :use => :slugged
# ...