Skip to content

Instantly share code, notes, and snippets.

@maclunar
maclunar / auto_theme_switching.md
Created September 21, 2023 09:11
Automatic theme switching in macOS

Automatic theme switching in macOS

iTerm2

Base on this guide:

  1. In iTerm2 go to Scripts > Manage > New Python Script (python runtime may need installing)
  2. Choose Basic script type
  3. Chose Long-Running Daemon script interval
  4. Name the script in some descriptive way like auto_theme_switch.py and paste this as content:
@maclunar
maclunar / compose_and_rails_updated.md
Created January 15, 2021 11:18
Quickstart: Compose and Rails updated

This is an updated version of Quickstart: Compose and Rails from Docker docs. Updates are mostly about using Rails 6 and webpacker.

First, create a directory for the new app:

mkdir myapp; cd myapp

Fill in the Dockerfile:

FROM ruby:2.7
@maclunar
maclunar / .spacemacs
Last active April 29, 2019 12:01
spacemacs dotfile
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@maclunar
maclunar / init.vim
Last active June 14, 2022 15:10
.config/nvim/init.vim file, 2020-07-20
" maclunar's .vimrc file
" now more of a init.vim file
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set shell=/bin/sh
" ------------------------------------------------------------------------------
" vim-plug
" ------------------------------------------------------------------------------
call plug#begin()
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
;; I need my Polish characters
(setq mac-right-option-modifier nil)
)
@maclunar
maclunar / karabiner.json
Created May 7, 2018 06:06
Config for remapping keys with karabiner. Place in ~/.config/karabiner/
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@maclunar
maclunar / gitconfig
Last active November 17, 2018 08:10
[pull]
rebase = true
[user]
name = Maciej Wilk
email = maclunar@gmail.com
[alias]
aa = add --all
di = diff
dc = diff --cached
# Load the default .profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# For RVM and nvm
if [ -d "$HOME/Code" ] ; then
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
" maclunar's .vimrc file
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set shell=/bin/sh
" use vim-plug
call plug#begin()
Plug 'ctrlpvim/ctrlp.vim' " fuzzy file search
Plug 'rking/ag.vim' " silver searcher search
Plug 'tpope/vim-fugitive' " git stuff
@maclunar
maclunar / replace_with_local_databse
Created May 7, 2018 05:57
Replace local database with latest heroku dump
#!/bin/bash
# from app $1 to local database $2
#
# Place this in your /usr/local/bin folder and add execution privelages
# Example usage:
# replace_with_production_db my_app_name my_app_database_dev
echo “Downloading database from $1...”
curl -o latest_db.dump `heroku pg:backups public-url --app $1`
echo “Dropping database $2...”