Skip to content

Instantly share code, notes, and snippets.

View shime's full-sized avatar

Hrvoje Šimić shime

View GitHub Profile
@shime
shime / .tmux.conf
Last active July 16, 2025 15:46
Tokyo Night Storm theme for tmux status bar
# Tokyo Night Storm theme
set -g status-style 'bg=#24283b fg=white'
# Print full session name in the status bar
set -g status-left-length 100
set -g status-left "#[fg=#73daca]#S #[default]"
# Set the current window to display in a different color
set-option -g window-status-current-style "fg=#bb9af7,bold"
@shime
shime / reseed.rake
Last active December 18, 2018 10:30
Reseed database in Rails without dropping it. Originally posted at https://shime.sh/til/faster-database-resets-in-rails
namespace :db do
desc 'Clears the database and then seeds it'
task reseed: :environment do
Rake::Task["db:truncate"].invoke
Rake::Task["db:seed"].invoke
end
desc 'Clears the database'
task truncate: :environment do
puts "Truncating database"
source 'https://rubygems.org'
gem "minitest"
@shime
shime / eighth.rb
Last active June 6, 2016 14:08
my codility solutions
def solution(a)
counter = [0] * a.length
a.each do |element|
if ! (1 <= element && element <= a.length)
return 0
else
if counter[element-1] != 0
return 0
else
counter[element-1] = 1
@shime
shime / .gitignore
Last active November 8, 2015 13:57
Hello world over bittorrent DHT
node_modules
*.log

Keybase proof

I hereby claim:

  • I am shime on github.
  • I am shime (https://keybase.io/shime) on keybase.
  • I have a public key whose fingerprint is 3436 35B8 B1DE 69EC DB61 97F5 936B 516B 5B9C 52BB

To claim this, I am signing this object:

@shime
shime / console.js
Last active October 1, 2015 22:15
pick a random meetup attendee
// Paste this into your browser console to pick a random attendee
// from the list of users in the "Going" section of your
// event at meetup.com
//
// Skips the organizer (first in the list).
$('#rsvp-list li').eq(Math.floor(Math.random()*($('#rsvp-list li').length - 1)) + 1).find('a').text()
@shime
shime / readme.md
Last active August 29, 2015 14:23
debugging Ember components and views in the newer Ember versions
@shime
shime / Dockerfile
Last active August 29, 2015 14:18
confiig files
FROM base/archlinux:latest
# install dependencies
RUN pacman -Syu --noconfirm
RUN pacman --noconfirm -S base-devel yajl nodejs git openssh imagemagick python2
RUN ln -s /usr/bin/python2 /usr/bin/python
# install yaourt
WORKDIR /tmp/scratch
RUN curl https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz | tar zx

Keybase proof

I hereby claim:

  • I am shime on github.
  • I am shime (https://keybase.io/shime) on keybase.
  • I have a public key whose fingerprint is 3032 0F07 65F2 3ABC 8BCB 3AF6 D409 B2B4 1F90 597C

To claim this, I am signing this object: