Skip to content

Instantly share code, notes, and snippets.

@niftycode
niftycode / createPythonProject.sh
Last active March 29, 2024 15:45
Shell script to create a Python project
#!/bin/bash -
#===============================================================================
#
# FILE: createPythonProject.sh
#
# USAGE: ./createPythonProject.sh
#
# DESCRIPTION: Create a new Python project
#
# VERSION: 1.3
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active March 29, 2024 15:44
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@Delivator
Delivator / google_search_maps_addon.user.js
Last active March 29, 2024 15:39 — forked from Daan-Grashoff/google_search_maps_addon.js
Bring back the google maps button and make map image clickable when searching on google
// ==UserScript==
// @name Google Search Maps Fix
// @namespace http://tampermonkey.net/
// @version 2024-03-07
// @description Bring Google maps button back
// @author Daan Grashoff / Delivator
// @match https://www.google.com/search*
// @include https://www.google.tld/search*
// @icon https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @grant none
@SavageCore
SavageCore / 1-readme.md
Last active March 29, 2024 15:38 — forked from cdleveille/Install⁄Update Xone
Install or update xone driver for Steam Deck (desktop shortcut and bash script)

Enjoying this script? Consider buying me a beer/coffee!

ko-fi

First time setting up your Deck? You may enjoy my setup guide. It'll get you started on Emulation.

Improvements

Main changes at initial release versus cdleveille's original script:

  • Added zenity for a basic "GUI"
@beatzxbt
beatzxbt / orderbook_testing.py
Created March 29, 2024 13:21
fast orderbook implementation in numpy/numba
import numpy as np
from time import perf_counter_ns
from numba import njit, int64, float64, bool_
from numba.experimental import jitclass
from scipy.stats import skewnorm
from numpy.typing import NDArray
@njit(bool_[:](float64[:], float64[:]), nogil=True)
def isin(a: NDArray, b: NDArray) -> NDArray:
out = np.empty(a.size, dtype=bool_)
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active March 29, 2024 15:36
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@steven2358
steven2358 / ffmpeg.md
Last active March 29, 2024 15:32
FFmpeg cheat sheet
@dearyangyu
dearyangyu / maya_get_mtx_relative_to_other_object.py
Created March 23, 2024 04:46 — forked from CGLion/maya_get_mtx_relative_to_other_object.py
Python for Maya - Get object's transform matrix relative to other object's transform
from maya.api.OpenMaya import MVector, MMatrix, MPoint
import maya.cmds as cmds
def get_relative_transform (node,coordinate_space_node):
node_matrix = MMatrix(cmds.xform(node, q=True, matrix=True, ws=True))
parent_matrix = MMatrix(cmds.xform(coordinate_space_node, q=True, matrix=True, ws=True))
return (node_matrix * parent_matrix.inverse())
node_a = (cmds.ls(sl=1,sn=True))[0]
node_b = (cmds.ls(sl=1,sn=True))[1]
@potibm
potibm / gist:e0dacccbacd0293c021d84d2cbce2adc
Last active March 29, 2024 15:31
GitHub Action to submit changed Urls to IndexNow
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Build Jekyll site
- name: Generate CSV with MD5 Hashes
run: |
cd build
find . -type f -exec md5sum {} + | sed 's/\.\///' | sort -t $'\t' -k 2 > file_hashes.csv
working-directory: ${{ github.workspace }}
@bmaupin
bmaupin / free-backend-hosting.md
Last active March 29, 2024 15:30
Free backend hosting