Skip to content

Instantly share code, notes, and snippets.

View pifabs's full-sized avatar

pifabs

View GitHub Profile
@bmcbm
bmcbm / setup-nvdia-suspend.sh
Last active June 27, 2024 16:29
NVIDIA Suspend fix
# Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<=====
# https://download.nvidia.com/XFree86/Linux-x86_64/450.66/README/powermanagement.html
# https://forums.developer.nvidia.com/t/unable-to-set-nvidia-kernel-module-parameters/161306
# Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage
# as sugested by @goombah88 in the comments below.
TMP_PATH=/var/tmp
TMPL_PATH=/usr/share/doc/nvidia-driver-460/
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf
@importdata
importdata / CountVectorizer Example
Created May 18, 2020 02:16
Kaggle Twitter Data CountVectorizer Example
document = ["This is Import Data's YouTube channel",
"Data Science is my passion and it is fun",
"Please subscribe to my channel"]
# create the transform
vectorizer = CountVectorizer()
# tokenize and make the document into a matrix
doc_term_matrix = vectorizer.fit_transform(document)
pd.DataFrame(doc_term_matrix.toarray(),columns = vectorizer.get_feature_names())

Git Merge To FF Or Not To FF

Created May 13, 2020

Intro

In git merge there are several ways to merge branches however, the most commonly used options are --ff-only and --no-ff. The --ff-only option will resolve the merge as a fast-forward when possible. When not possible, it refuses to merge and will exit with a non-zero status. Best examples used by this options are branches from features and hotfixes.

Merge develop to master

{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active June 25, 2024 13:22
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@revant
revant / nginx-files.conf
Last active May 30, 2024 18:48
Frappe CORS for nginx
location / {
rewrite ^(.+)/$ $1 permanent;
rewrite ^(.+)/index\.html$ $1 permanent;
rewrite ^(.+)\.html$ $1 permanent;
# Allow CORS for static files
add_header Access-Control-Allow-Origin $cors_origin;
add_header Access-Control-Allow-Methods "GET, OPTIONS";
location ~* ^/files/.*.(htm|html|svg|xml) {
@mikehazell
mikehazell / robbyrussell.zsh_theme
Last active February 16, 2024 23:35
oh-my-zsh Default Theme plus Node version info
# oh-my-zsh Theme
# Default robbyrussell theme with node version info.
# Installation: place this file in .oh-my-zsh/custom/themes/robbyrussell.zsh_theme
function node_prompt_version {
if which node &> /dev/null; then
echo "%{$fg_bold[blue]%}node(%{$fg[red]%}$(node -v)%{$fg[blue]%}) %{$reset_color%}"
fi
}
@stuntgoat
stuntgoat / pre-commit.sh
Last active April 30, 2024 02:11
Git pre-commit hook for finding Python added 'print' statements.
#!/bin/sh
# To enable this hook, rename this file to "pre-commit".
###############################################################################
# https://gist.github.com/stuntgoat/8800170
# Git pre-commit hook for finding and warning about Python print
# statements.
#
@8bitDesigner
8bitDesigner / 1.md
Last active February 1, 2024 06:42
Git post-merge hook which, when you run `git merge` or `git pull` will then `bundle` if the project's Gemfile changed, or `npm install` if the project's package.json changed.Inspired and based off of https://gist.github.com/bumi/5706550

Make bundleing and npm installing easy

This repo has some handy handy hooks to run bundle or npm install whenever you:

  • git checkout a new branch with a different Gemfile or package.json
  • git pull a change to Gemfile or package.json

How can I has this!!?

  1. git clone https://gist.github.com/5869846.git hooks &amp;&amp; cd hooks &amp;&amp; chmod +x install