Skip to content

Instantly share code, notes, and snippets.

View mirekphd's full-sized avatar

mirekphd

View GitHub Profile
@mlgill
mlgill / rmerge.py
Last active March 8, 2023 18:19
A modified version of pandas merge command that will replace overlapping columns not associated with the join rather than appending a suffix.
import pandas as pa
def rmerge(left,right,**kwargs):
"""Perform a merge using pandas with optional removal of overlapping
column names not associated with the join.
Though I suspect this does not adhere to the spirit of pandas merge
command, I find it useful because re-executing IPython notebook cells
containing a merge command does not result in the replacement of existing
columns if the name of the resulting DataFrame is the same as one of the

How do I do this thing?

I'm not aware of how to use Google, how do I do this basic thing in Language X?

tagged coding, question

edited by Grammar Nazi (2.5M), asked by 1337z0r (2)

Answer 1 (12)

@carlessanagustin
carlessanagustin / lists-dictionary.yml.md
Last active January 22, 2024 21:55
Lists & Dictionary YAML Syntax by example
@glynnbird
glynnbird / toredis.py
Created September 26, 2016 10:24
Python script to convert simple Redis commands to raw Redis protocol
#!/usr/bin/python
# reads a sequence of REDIS commands from stdin e.g.
# SET mykey "hello world
# into Redis protocol e.g.
# *3
# $3
# SET
# $5
# mykey
@tamas-molnar
tamas-molnar / kubectl-shortcuts.sh
Last active June 4, 2025 16:08
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 15, 2025 17:17
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@petitviolet
petitviolet / nginx_deployment.yaml
Created March 11, 2018 11:04
sample Nginx configuration on Kubernetes using ConfigMap to configure nginx.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
events {
@dudash
dudash / oc-waitforpod.sh
Last active April 21, 2022 19:42
OpenShift CLI wait for argument pod to go "Running" - or prompt if no pod name given
#!/bin/bash
# Simple script to wait for named pod
#
# if no arguments are specified it will prompt
# if 1 argument is specified it will look for a pod with that name
# if more than 1 argument is specified it will only use the 1st and ignore the rest
#
# tested against oc 3.9 - might not work with other versions
@teeks99
teeks99 / Jenkinsfile
Created June 29, 2018 15:02
Jenkinsfile with e-mail
pipeline {
agent any
stages {
stage('Build'){
steps {
echo "Running job: ${env.JOB_NAME}\nbuild: ${env.BUILD_ID} - ${env.BUILD_URL}\nblue ocean: ${env.RUN_DISPLAY_URL}"
}
}
}
@eddex
eddex / Install CUDA 10.1 on Ubuntu 18.04.md
Last active August 23, 2024 23:55
How to install CUDA 10.1 on Ubuntu 18.04

How to install CUDA 10.1 on Ubuntu 18.04

A clean installation of Ubuntu 18.04.02 LTS was used.

This gist is an extension to the official docs, adding missing parts and instructions.

2 pre-install actions

follow the pre-installation actions on: