Skip to content

Instantly share code, notes, and snippets.

View thepante's full-sized avatar

Fabián Pérez thepante

View GitHub Profile
@ahmedkhalf
ahmedkhalf / Sudoku.com AI Solver.py
Last active January 12, 2024 16:12
Solve sudoku.com using Selenium!
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
# Make sure chrome driver is in your path,
# full download totorial on official python selenium website.
# Start broswer with sudoku.com
@starlinq
starlinq / cloud.mail.ru-webdav.md
Last active June 25, 2023 16:57
Подключение к Cloud.mail.ru с помощью WebDAV эмулятора в Убунту 18.04
title date
Подключение к Cloud.mail.ru с помощью WebDAV эмулятора в Убунту 18.04
2019-02-06

Подключение к Cloud.mail.ru с помощью WebDAV эмулятора в Убунту 18.04

Инструкцию для Убунту 20.04 см. здесь.

@Sporif
Sporif / userChrome.css
Last active April 26, 2022 09:38
NOTE: Doesn't work with Firefox 72+. Add userChrome.js support to Firefox with just userChrome.css. A compact version of https://github.com/Sporif/firefox-quantum-userchromejs. Instead of loading userChrome.xml file it uses a data URI.
toolbarbutton#alltabs-button {
-moz-binding: url(data:text/plain;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8IS0tIENvcHlyaWdodCAoYykgMjAxNyBIYWdnYWkgTnVjaGkNCkF2YWlsYWJsZSBmb3IgdXNlIHVuZGVyIHRoZSBNSVQgTGljZW5zZToNCmh0dHBzOi8vb3BlbnNvdXJjZS5vcmcvbGljZW5zZXMvTUlUDQogLS0+DQoNCjwhLS0gUnVuIHVzZXJDaHJvbWUuanMvdXNlckNocm9tZS54dWwgYW5kIC51Yy5qcy8udWMueHVsLy5jc3MgZmlsZXMgIC0tPg0KPGJpbmRpbmdzIHhtbG5zPSJodHRwOi8vd3d3Lm1vemlsbGEub3JnL3hibCI+DQogICAgPGJpbmRpbmcgaWQ9ImpzIj4NCiAgICAgICAgPGltcGxlbWVudGF0aW9uPg0KICAgICAgICAgICAgPGNvbnN0cnVjdG9yPjwhW0NEQVRBWw0KICAgICAgICAgICAgICAgIGlmKHdpbmRvdy51c2VyQ2hyb21lSnNNb2QpIHJldHVybjsNCiAgICAgICAgICAgICAgICB3aW5kb3cudXNlckNocm9tZUpzTW9kID0gdHJ1ZTsNCg0KICAgICAgICAgICAgICAgIHZhciBjaHJvbWVGaWxlcyA9IEZpbGVVdGlscy5nZXREaXIoIlVDaHJtIiwgW10pLmRpcmVjdG9yeUVudHJpZXM7DQogICAgICAgICAgICAgICAgdmFyIHh1bEZpbGVzID0gW107DQogICAgICAgICAgICAgICAgdmFyIHNzcyA9IENjWydAbW96aWxsYS5vcmcvY29udGVudC9zdHlsZS1zaGVldC1zZXJ2aWNlOzEnXS5nZXRTZXJ2aWNlKENpLm5zSVN0eWxlU2hlZXRTZXJ2aWNlKTsNCg0KICAgICAgICAgIC
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.
@cryptexvinci
cryptexvinci / woo_rename_checkout.php
Last active December 20, 2023 09:48
Rename WooCommerce checkout field label & placeholder
<?php
// WooCommerce Rename Checkout Fields
add_filter( 'woocommerce_checkout_fields' , 'custom_rename_wc_checkout_fields' );
// Change placeholder and label text
function custom_rename_wc_checkout_fields( $fields ) {
$fields['billing']['billing_first_name']['placeholder'] = 'Wonka';
$fields['billing']['billing_first_name']['label'] = 'Your Awesome First Name';
return $fields;
}
@ankurk91
ankurk91 / bash_profile.md
Last active October 22, 2023 12:16
:octocat: Git branch name in Linux/Mac Bash Terminal

Mac OS : Show your git branch name on your bash terminal

⚠️ Does not work in zsh terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 21, 2024 22:10
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:

@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active April 18, 2024 21:00
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4