Skip to content

Instantly share code, notes, and snippets.

@o3bvv
o3bvv / AJAX_CSRF.js
Created January 12, 2015 15:09
Setup Django's CSRF for AJAX
function get_cookie(name) {
var cookieValue = null
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';')
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i])
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1))
@o3bvv
o3bvv / console
Last active September 6, 2023 04:05
SSSHHH! Testing Python SSH client with auth via private key
# Install our dependencies
$ pip install -r <(wget -O- http://bit.ly/ssh_test_requirements)
# Generate key pair without password
$ ssh-keygen -t rsa -C "user@unicorn"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/alex/.ssh/id_rsa): user.key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
@o3bvv
o3bvv / Default.sublime-keymap
Last active May 7, 2017 13:53
Sublime settings
[
{ "keys": ["alt+c", "alt+up"], "command": "upper_case" },
{ "keys": ["alt+c", "alt+down"], "command": "lower_case" },
{ "keys": ["alt+c", "alt+t"], "command": "title_case" },
{ "keys": ["alt+c", "alt+s"], "command": "convert_to_snake"},
{ "keys": ["alt+c", "alt+m"], "command": "convert_to_camel"},
{ "keys": ["alt+c", "alt+p"], "command": "convert_to_pascal"},
{ "keys": ["alt+c", "alt+."], "command": "convert_to_dot"},
{ "keys": ["alt+c", "alt+-"], "command": "convert_to_dash"},
{ "keys": ["alt+c", "alt+w"], "command": "convert_to_separate_words"},
@o3bvv
o3bvv / keybase.md
Created July 5, 2017 17:22
keybase.md

Keybase proof

I hereby claim:

  • I am oblalex on github.
  • I am oblalex (https://keybase.io/oblalex) on keybase.
  • I have a public key ASC1jRTbyevO2_U4soHZqV42KdtVoBErzytgEUv5GvKLwgo

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>IL-2 FB Locations</name>
<description></description>
<Style id="primary">
<LineStyle><color>ff0088ff</color><width>5</width></LineStyle>
<PolyStyle><color>660088ff</color></PolyStyle>
</Style>
@o3bvv
o3bvv / keybase.md
Created March 12, 2019 13:24
Keybase proof

Keybase proof

I hereby claim:

  • I am oblalex on github.
  • I am oblalex (https://keybase.io/oblalex) on keybase.
  • I have a public key ASAYaQtPc4HObTkRNUyutE0_zjIESyfe8FC231SGgBZbWwo

To claim this, I am signing this object:

@o3bvv
o3bvv / cloudSettings
Last active October 9, 2020 18:34
vs-settings
{"lastUpload":"2020-10-09T18:34:13.168Z","extensionVersion":"v3.4.3"}
@o3bvv
o3bvv / .vimrc
Last active July 20, 2022 14:13
vim config
syntax enable
set background=dark
colorscheme solarized
set tabstop=2
set softtabstop=2
set expandtab
set number
set showcmd
set cursorline
@o3bvv
o3bvv / run.sh
Last active March 24, 2020 14:14
Resize Big Pictures in Bulk
#!/usr/bin/env bash
CURRENT_DIR=$(pwd)
MAX_SIDE_SIZE=1024 # see also: https://www.imagemagick.org/script/command-line-processing.php#geometry
JPEG_EXTENSION_PRIMARY=jpg
JPEG_CONVERSION_QUALITY=85
@o3bvv
o3bvv / gist:6854531d3467e3fecc23a40fa4722c4d
Created August 23, 2020 15:18
Windows Explorer — Start At "My PC"
%SystemRoot%\explorer.exe /E,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}