Skip to content

Instantly share code, notes, and snippets.

View faleev's full-sized avatar

Pavlo Falieiev faleev

View GitHub Profile
@ih2502mk
ih2502mk / list.md
Last active May 3, 2024 08:25
Quantopian Lectures Saved
import numpy as np
import cv2
# for windows, mac users
# from PIL import ImageGrab
# for linux users
import pyscreenshot as ImageGrab
# four character code object for video writer
fourcc = cv2.VideoWriter_fourcc(*'XVID')
# video writer object
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 29, 2024 12:53
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:

@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active April 25, 2024 22:55
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@benny-shotvibe
benny-shotvibe / Jenkins.md
Last active August 29, 2023 14:55
Installing Jenkins from scratch

Installing Jenkins from scratch

This is how I install Jenkins on a bare system. I'm using Ubuntu 12.04 32bit

First Steps

System Config

Always good to update the system packages after a fresh install:

@bootstraponline
bootstraponline / appium_android.bash
Last active December 17, 2015 08:29
Start appium from source, open emulator, and cd into test folder.
# code goes in ~/.bash_profile
# tested on OS X
export APPIUM_HOME="$HOME/Desktop/appium"
export TEST_HOME="$HOME/path/to/tests"
export APPIUM_AVD="t18"
function three {
# does node exist?
[[ $(ps axo pid,command | grep "[0-9]\+ node" | wc -l) -gt 0 ]] && \
@kordless
kordless / stackgeek.manifest
Last active November 11, 2021 09:44
Installing OpenStack on Ubuntu 12.04 LTS in for StackGeek
title: Installing OpenStack Icehouse on Ubuntu 14.04 LTS in 10 Minutes
author: http://github.com/kordless
summary: A 10 minute guide on installing OpenStack Icehouse on Ubuntu 14.04 LTS.
type: guide
published: 1336779260
meta: openstack
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@mkottman
mkottman / twoline_prompt.sh
Last active July 19, 2023 06:53
A two-line colored Bash prompt (PS1) with Git branch and a line decoration which adjusts automatically to the width of the terminal. Recognizes SVN, Git and Fossil version control systems and shows the current branch/revision.
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Recognizes and shows Git, SVN and Fossil branch/revision.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"