Skip to content

Instantly share code, notes, and snippets.

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@hanleybrand
hanleybrand / requests_image.py
Created December 6, 2012 03:56
Download images with Requests: HTTP for Humans
import requests
from io import open as iopen
from urlparse import urlsplit
def requests_image(file_url):
suffix_list = ['jpg', 'gif', 'png', 'tif', 'svg',]
file_name = urlsplit(file_url)[2].split('/')[-1]
file_suffix = file_name.split('.')[1]
i = requests.get(file_url)
if file_suffix in suffix_list and i.status_code == requests.codes.ok:
@lyoshenka
lyoshenka / search-git-history.md
Last active April 26, 2024 23:16
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@antespi
antespi / Odoo - Rename an addon without losing data.md
Last active April 10, 2024 15:29
Odoo - Rename an addon without losing data

Odoo - Rename an addon without losing data

Rename addon

  • Change __openerp__.py addon name field
  • Change README.rst file

Font Stack

Font Device Targeted
-apple-system (San Francisco) iOS Safari, macOS Safari, macOS Firefox
BlinkMacSystemFont (San Francisco) macOS Chrome
Segoe UI Windows
Roboto Android, Chrome OS
Oxygen / Oxygen-Sans KDE
Fira Sans Firefox OS
@muktupavels
muktupavels / toggle-decorations.c
Last active January 28, 2024 12:59
Simple app to toggle window decorations.
/*
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active April 12, 2024 13:24
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

@tbutts
tbutts / tmux-migrate-options.py
Last active February 29, 2024 08:11
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@laggardkernel
laggardkernel / cache-first.md
Created July 4, 2019 04:42
Cash First #zsh
_env_init() {
  # init version manager without rehash on startup
  local SHELL_NAME="zsh"
  local init_args=(- --no-rehash zsh)
  local zshrc="$HOME/.zshrc"
  
  # For security on Linux
  [[ -n $XDG_RUNTIME_DIR ]] && local TMPDIR="$XDG_RUNTIME_DIR"
@ofelix03
ofelix03 / Odoo v12 to v14: Technical Changes Note.md
Last active June 15, 2021 10:35
Odoo v12 to v14: Technical Changes Note

Accounts

  • account.register.payments model (in v12) renamed to account.payment.register (v13 & v14)

  • _compute_reconciled_invoice_ids(...) model (v12 & v13) renamed to _compute_stat_buttons_from_reconciliation(...) (v14)*

  • account.asset.asset (v10) model renamed to account.asset(in v12 upwards) and moved from core addons to enterprise [module: account_asset]

  • communication" field on account.payment has been removed in v14