Skip to content

Instantly share code, notes, and snippets.

View guicattani's full-sized avatar
🐱

Guilherme Cattani guicattani

🐱
  • Berlin
View GitHub Profile
def positional_arguments(arg1, arg2, arg3)
puts [arg1, arg2, arg3].join(' ')
end
positional_arguments('Hello', 'Jean Luc', 'Picard')
def positional_with_hash(arg, opts = {})
puts [arg, opts[:firstname], opts[:lastname]].join(' ')
end
# Set vi key bindings mode
set -g mode-keys vi
set -g status-keys vi
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# List of plugins
@jubicode
jubicode / select_by_color.py
Last active May 3, 2023 16:07 — forked from tamask/select_by_color.py
Select By Color (Blender)
import bpy
from mathutils import Color
bl_info = {
'name': 'Select By Color',
'author': 'Tamas Kemenczy, updated for 2.8 by Piotr Zgodziński',
'version': (0, 2),
'blender': (2, 80, 3),
'location': 'View3D > Specials > Select By Color',
'description': 'Select all faces with the same vertex color of the selected face',
@Janderson
Janderson / ShareAFolderWithWindowsUsingVirtualBox.me
Last active May 29, 2019 18:09
Docker share folder with windows using virtualbox
First using virtualbox interface, go to dockermachine usually it named as default, after that go to Shared Folders > Shared Folder Settings and share choose a folder into windows usually I choose my projects folder and choose a name [NameOfYourSharedFolder].
# create a volume into docker
docker volume create projects
# remove the old folder data
rmdir /mnt/sda1/var/lib/docker/volumes/projects/_data/
@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active March 20, 2024 19:42
setup L2TP IPSEC VPN in archlinux using NetworkManager
@480
480 / gist:3b41f449686a089f34edb45d00672f28
Last active April 11, 2024 23:56
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@abstractart
abstractart / books.md
Last active April 13, 2024 00:01
Free Programming Ebooks - O'Reilly Media. Codeship free ebooks here - https://bit.ly/2oQ0knQ
@wrburgess
wrburgess / example_job.rb
Last active April 6, 2020 20:17
ActiveJob on Rails 5 with RSpec
# app/jobs/example_job.rb
class ExampleJob < ActiveJob::Base
queue_as :default
rescue_from(ActiveRecord::RecordNotFound) do
retry_job wait: 1.minute, queue: :default
end
def perform(param_1, param_2)
@xndc
xndc / tunejack.sh
Last active March 10, 2024 16:42
Instant radio streaming script using the TuneIn API
#!/bin/bash
# tunejack.sh uses the TuneIn public API (at opml.radiotime.com) to search for
# a radio station, print out its details and try to play it somehow.
if [ "$#" -eq 0 ]; then
echo "$0: search for a radio station using the TuneIn API"
echo "Usage: $0 PATTERN"
exit 1
fi
@nathanows
nathanows / gist:b5346256b06d8ce61f8e
Last active November 3, 2022 09:34
RSpec: Testing Token/API Key Authentication
##
## TOKEN/API KEY AUTHENTICATION
## This was based on blogger-advanced
## Continuing from the class we built this in...
## if not already done, you'll need to make an ApiKey table in the DB 'rails g model ApiKey token:string'
##
# app/controllers/api/v1/articles_controller.rb
class Api::V1::ArticlesController < ApplicationController
#...