Skip to content

Instantly share code, notes, and snippets.

View pawelkl-zz's full-sized avatar

Paweł Kłosiewicz pawelkl-zz

View GitHub Profile

Idiot-Proof Git Aliases

@jaspervdj
jaspervdj / volume.rb
Created February 7, 2011 16:17
Set pulseaudio volume from the command line
#!/usr/bin/ruby
# Pulseaudio volume control
class Pulse
attr_reader :volumes, :mutes
# Constructor
def initialize
dump = `pacmd dump`.lines
@volumes = {}
@docwhat
docwhat / rails31init.md
Created September 3, 2011 03:01 — forked from niquola/rails31init.md
Rails 3.1 with Rspec, Factory Girl, Haml, Database Cleaner, Spork, and Guard

Install Rails 3.1

gem install rails

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@jewilmeer
jewilmeer / RubyTest.sublime-build
Created January 6, 2012 12:08
Sublime 2 with .rvmrc loading
// This file lives @ /Library/Application Support/Sublime Text 2/Packages/User/RubyTest.sublime-build
{
"ruby_unit_exec": "~/bin/rvm_ruby ruby -Itest",
"ruby_cucumber_exec": "~/bin/rvm_ruby cucumber --no-color",
"ruby_rspec_exec": "~/bin/rvm_ruby rspec",
"ruby_unit_folder": "test",
"ruby_cucumber_folder": "features",
"ruby_rspec_folder": "spec"
}
@uriel1998
uriel1998 / volume.rb
Created February 10, 2012 17:55 — forked from jaspervdj/volume.rb
Set PulseAudio volume, mute, unmute, and change default sink (and automagically switch running audio streams) from the commandline
#!/usr/bin/ruby
#
# Moved to: https://github.com/uriel1998/volumerb
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-sa/3.0/.
#
# Forked/derived from original by Jasper Van der Jeugt (jaspervdj);
@andsens
andsens / bootstrap_homeshick.sh
Last active December 27, 2023 12:47
Script that can set up an entire user account with homeshick automatically
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the raw (<>) button.
### Set some command variables depending on whether we are root or not ###
# This assumes you use a debian derivate, replace with yum, pacman etc.
aptget='sudo apt-get'
chsh='sudo chsh'
# Useful aliases {{{
alias c 'clear'
alias hl 'less -R'
alias paththis 'set PATH (pwd) $PATH'
alias ef 'vim ~/.config/fish/config.fish'
# }}}
# Environment variables {{{
@narze
narze / Default (OSX).sublime-keymap
Created July 10, 2012 12:36
My Sublime Text 2 Key bindings (some macros and packages required)
[
{ "keys": ["alt+;"], "command": "run_macro_file", "args": {"file": "Packages/User/Semicolon EOL.sublime-macro"} },
{ "keys": ["alt+["], "command": "run_macro_file", "args": {"file": "Packages/User/{} EOL.sublime-macro"} },
{ "keys": ["alt+,"], "command": "run_macro_file", "args": {"file": "Packages/User/Colon EOL.sublime-macro"} },
{ "keys": ["alt+end"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["super+;"], "command": "show_overlay", "args": {"overlay": "goto", "text": "#"} },
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol", "extend": false} },
{ "keys": ["ctrl+home"], "command": "move_to", "args": {"to": "bof", "extend": false} },
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@victorporof
victorporof / config.fish.sh
Last active July 18, 2022 08:59
config.fish
# Enviroment setup
# Path vars
set -gx PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin
set -gx PATH /opt/homebrew/bin $PATH
set -gx PATH $PATH $HOME/.local/bin
set -gx PATH $PATH $HOME/.cargo/bin
set -gx PATH $PATH $HOME/.yarn/bin