This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import i3 | |
def get_workspace(position = None): | |
mon = next(el for el in i3.get_workspaces() if el["focused"]) | |
current_output = next(output for output in i3.get_outputs() if (output["active"] and (output["name"] == mon["output"]))) | |
if position is None: | |
position = "current" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Properly cycle through named workspaces on i3, preventing bugs related to "3: foo" names | |
# And in your .i3/config | |
# | |
# bindsym Mod4+h exec /home/carlesso/bin/i3_output prev | |
# bindsym Mod4+l exec /home/carlesso/bin/i3_output next | |
import sys | |
import i3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
times in msec | |
clock self+sourced self: sourced script | |
clock elapsed: other lines | |
000.005 000.005: --- VIM STARTING --- | |
000.058 000.053: Allocated generic buffers | |
000.111 000.053: locale set | |
000.123 000.012: GUI prepared |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
times in msec | |
clock self+sourced self: sourced script | |
clock elapsed: other lines | |
000.009 000.009: --- VIM STARTING --- | |
000.110 000.101: Allocated generic buffers | |
000.202 000.092: locale set | |
000.220 000.018: GUI prepared |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pry::Commands.create_command 'echo' do | |
description 'Echo the input' | |
banner <<-BANNER | |
Usage: echo [ -j <joiner> ] <words> | |
BANNER | |
def setup | |
@joiner = ' ' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Create PostgreSQL Users for rails applications | |
sudo: yes | |
sudo_user: postgres | |
when: item.db == 'postgresql' | |
postgresql_user: db={{ item.postgresql.database }} name={{ item.postgresql.username }} password={{ item.postgresql.password }} priv=ALL | |
with_items: rails_applications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Something | |
key :foo | |
def do_foo_check | |
# I'd like to access key somehow here | |
put "I'm doing #{what}" | |
# Expecting I'm doing foo | |
end | |
key :foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[16] pry(main)> show-method 'string'.=~ | |
From: string.c (C Method): | |
Owner: String | |
Visibility: public | |
Number of lines: 14 | |
static VALUE | |
rb_str_match(VALUE x, VALUE y) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%w{git bash-completion htop multitail sudo vim wget autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev}.each do |pkg| | |
package pkg do | |
action :install | |
end | |
end | |
execute 'apt-get update' do | |
action :nothing | |
end.run_action(:run) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%w{git bash-completion htop multitail sudo vim wget autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev}.each do |pkg| | |
puts "HERE: #{pkg}" | |
apt_package pkg | |
end | |
execute 'apt-get update' do | |
action :nothing | |
end.run_action(:run) | |
include_recipe 'basic::users' |
OlderNewer