Skip to content

Instantly share code, notes, and snippets.

View hottabxp's full-sized avatar
🏠
Working from home

hottabxp

🏠
Working from home
View GitHub Profile
USER='username'
PASS='passwd'
sudo useradd -m -d /home/$USER --password $(echo "$PASS" | openssl passwd -1 -stdin ) $USER
# omit 1,2 if env variables are otherwise set.
@simplesasha
simplesasha / gist:73005e8e08065d8c360dba09dc86626b
Created May 5, 2018 11:38
Интеграция Python 3 в Sublime Text 3 (простая и интерактивная консоль REPL)
1. Открываем Sublime Text -> Tools -> Build System -> New Build System
2. Вставляем в открывшийся файл следующие строки, чтобы получилось вот так:
{
"cmd": ["python3", "-i", "-u", "$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python"
}
3. Сохраняем файл с названием python3.sublime-build и не меняем путь предложенный редактором
@artynet
artynet / cross-compile-zlib-windows.sh
Last active July 15, 2021 03:19
Cross compile zLib for mingw32-w64
#!/bin/bash
# PREFIXDIR=$HOME/Programmi/Zlib-1.2.11-win32-x86
PREFIXDIR=$HOME/Programmi/win32-cross
make -f win32/Makefile.gcc BINARY_PATH=$PREFIXDIR/bin INCLUDE_PATH=$PREFIXDIR/include LIBRARY_PATH=$PREFIXDIR/lib SHARED_MODE=1 PREFIX=i686-w64-mingw32- install
@inaz2
inaz2 / enumwindows.py
Last active June 16, 2024 11:13
EnumWindows + GetWindowText by Python ctypes (Cygwin)
from ctypes import *
EnumWindows = cdll.user32.EnumWindows
EnumWindowsProc = CFUNCTYPE(c_bool, POINTER(c_int), POINTER(c_int))
GetWindowText = cdll.user32.GetWindowTextW
GetWindowTextLength = cdll.user32.GetWindowTextLengthW
IsWindowVisible = cdll.user32.IsWindowVisible
def enum_func(hwnd, lParam):
if IsWindowVisible(hwnd):
@vratiu
vratiu / .bash_aliases
Last active November 16, 2024 06:21
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@cobyism
cobyism / gh-pages-deploy.md
Last active November 11, 2024 00:02
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).