Skip to content

Instantly share code, notes, and snippets.

View bartlomiejdanek's full-sized avatar

Bartłomiej Danek bartlomiejdanek

View GitHub Profile
@bartlomiejdanek
bartlomiejdanek / .irbrc
Created December 20, 2011 19:23
IRB configuration
# Make gems available
require 'rubygems' if RUBY_VERSION <= '1.9.0'
# http://drnicutilities.rubyforge.org/map_by_method/
require 'map_by_method'
# Dr Nic's gem inspired by
# http://redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html
require 'what_methods'
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
# set-option -g status-style bg=black,fg=cyan# bg=base02, fg=yellow
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-jontinuum'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-pain-control'
@bartlomiejdanek
bartlomiejdanek / git-remove-file.sh
Created January 10, 2012 10:23
remove file from git history
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
@bartlomiejdanek
bartlomiejdanek / reinstall_drivers.bash
Created December 19, 2011 16:25
ubuntu - sound cart - reinstall drivers
#!/bin/bash
sudo su
apt-get --purge remove linux-sound-base alsa-base alsa-utils
apt-get install linux-sound-base alsa-base alsa-utils
apt-get install gdm ubuntu-desktop
reboot
@bartlomiejdanek
bartlomiejdanek / abc
Last active September 9, 2022 16:34
test
123
@bartlomiejdanek
bartlomiejdanek / hello_world.py
Created May 29, 2021 11:30
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@bartlomiejdanek
bartlomiejdanek / hello.rb
Created January 18, 2020 08:48
description ABC
content XYZ
@bartlomiejdanek
bartlomiejdanek / hello.rb
Created January 18, 2020 08:42
description ABC
content XYZ
class ImportDateStatsFromSparkExportBackfill < ImportDateStatsFromSparkExport
FROM_DATE = Date.new(2016, 6, 1)
TO_DATE = Date.new(2017, 1, 18)
private
def process_location(location)
(FROM_DATE..TO_DATE).each do |date|
$backfill_date = date
Rails.logger.info "===> Importing for #{$backfill_date}"
@bartlomiejdanek
bartlomiejdanek / splitter.rb
Created September 23, 2013 09:14
split your csv files
require 'csv'
infile = ARGV[0]
slice = ARGV[1] || 100
origin = CSV.open infile
all_lines = origin.readlines
header = all_lines.first
all_lines.delete_at(0)