Skip to content

Instantly share code, notes, and snippets.

View ochebotar's full-sized avatar
🎯
Focusing

Alik Chebotar ochebotar

🎯
Focusing
View GitHub Profile
@ochebotar
ochebotar / tcmount
Created May 27, 2021 12:13 — forked from fbatschi/tcmount
Bash Script to handle mounting/unmounting a truecrypt encrypted drive with tcplay
#!/bin/bash
losetup -f
while getopts “u” OPTION
do
case $OPTION in
u)
UMOUNT=1
;;
esac
@ochebotar
ochebotar / wp-config.php
Created May 6, 2020 08:36 — forked from ryanjbonnell/wp-config.php
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
@ochebotar
ochebotar / gist:12904418d256fa0170f174881ced4d5b
Created May 3, 2020 11:38 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@ochebotar
ochebotar / .zshrc
Last active July 26, 2020 05:30
.zshrc configuration file
# Path to your oh-my-zsh installation.
export ZSH="/Users/[USER-NAME]/.oh-my-zsh"
# Global path
PATH="$PATH:$M2_HOME/bin"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

Google Apps Script Spreadsheet Utilities and Custom Functions#

These utilities are grouped into related files, for simpler copy & paste to your scripts.

ConvertA1.gs

A couple of helper functions to convert to & from A1 notation.

cellA1ToIndex( string cellA1, number index )

@ochebotar
ochebotar / openconnect.md
Created September 4, 2018 03:25 — forked from gawbul/openconnect.md
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@ochebotar
ochebotar / tslint.json
Created May 22, 2018 06:28
TsLint preset for Angular development
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"prefer-object-spread": true,
"object-literal-shorthand": true,
"object-literal-key-quotes": [
true,
"as-needed"
### Keybase proof
I hereby claim:
* I am ochebotar on github.
* I am a1ik (https://keybase.io/a1ik) on keybase.
* I have a public key ASAYWXUmdsHUOIWqAnKumkr5qvuawm5gMSxvVg5IOIrt4go
To claim this, I am signing this object:
[user]
name = Me
email = me@gmail.com
[alias]
lg = log --graph --decorate --branches --oneline --remotes --tags --all
co = checkout
hist = log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short
[apply]
whitespace = nowarn
[color]