Skip to content

Instantly share code, notes, and snippets.

@otaq
otaq / .tmux.conf
Last active August 29, 2015 13:57
putty-tmux-vim-color
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g default-terminal "xterm"
set -g status-utf8 on
setw -g utf8 on
# disable mouse control by default - change 'off' to 'on' to enable by default.
setw -g mode-mouse off
set-option -g mouse-resize-pane off
set-option -g mouse-select-pane off
set-option -g mouse-select-window off
@otaq
otaq / sidekiq.rb
Last active January 3, 2016 00:51
Sidekiq
# To reset processed jobs:
Sidekiq.redis { |c| c.del('stat:processed') }
# and to reset failed jobs:
Sidekiq.redis { |c| c.del('stat:failed') }
# See workers
Sidekiq::Client.registered_workers
# See queues
Sidekiq::Client.registered_queues
# See all jobs for one queue
Sidekiq.redis { |r| r.lrange "queue:app_queue", 0, -1 }
guard 'rails', :port => 5000 do
watch('Gemfile.lock')
# watch(%r{^(config|lib)/.*})
# watch('spec/spec_helper.rb')
watch('config/routes.rb')
# watch('app/controllers/application_controller.rb')
# watch(%r{^spec/.+_spec\.rb})
# watch(%r{^app/(.+)\.rb})
watch(%r{^app/models/(.+)\.rb})
# watch(%r{^lib/(.+)\.rb})
# lib/tasks/deploy.rake
namespace :deploy do
desc 'Deploy to staging environment'
task :staging do
exec 'mina deploy -f config/deploy/staging.rb'
end
end
@otaq
otaq / sudo.sh
Created June 19, 2014 00:40
sudo: npm: command not found
alias sudo='sudo env PATH=$PATH'
#!/bin/sh
#
# CloudFlare Dynamic DNS
#
# Updates CloudFlare records with the current public IP address
#
# Takes the same basic arguments as A/CNAME updates in the CloudFlare API
# https://www.cloudflare.com/docs/client-api.html#s5.2
#
# Use with cron jobs etc.
@otaq
otaq / 0_reuse_code.js
Last active August 29, 2015 14: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

Keybase proof

I hereby claim:

  • I am otaq on github.
  • I am otaq (https://keybase.io/otaq) on keybase.
  • I have a public key whose fingerprint is 1880 8BDD 2A7B 6793 318F 3D62 22D5 8EEA 0390 ED0C

To claim this, I am signing this object:

@otaq
otaq / gist:a5bd456c741b99228610
Created February 22, 2016 06:29 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@otaq
otaq / CSS3 Media Queries Template
Created April 18, 2016 02:53
CSS3 Media Queries template
/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}