Skip to content

Instantly share code, notes, and snippets.

View svfat's full-sized avatar

Stan Fateev svfat

View GitHub Profile
@svfat
svfat / init.vim
Created January 26, 2023 15:17 — forked from celso/init.vim
Neovim setup for OSX users
syntax on
set ruler " Show the line and column numbers of the cursor.
set formatoptions+=o " Continue comment marker in new lines.
set textwidth=0 " Hard-wrap long lines as you type them.
set modeline " Enable modeline.
set esckeys " Cursor keys in insert mode.
set linespace=0 " Set line-spacing to minimum.
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
" More natural splits
set splitbelow " Horizontal split below current.
@svfat
svfat / understanding-word-vectors.ipynb
Created March 3, 2018 14:49 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@svfat
svfat / ip.txt
Created February 21, 2017 07:47
Рефералки для ИП
e-kontur.ru/?p=73255636 - 3 месяца бесплатной онлайн бухгалтерии
https://ya.tochka.com/referral/?promocode=c10980282c574d39 - 3 месяца банковского обслуживания за 1 рубль
ServiceNow
{
"service_name": "NetBIOS Name Service",
"sys_mod_count": "0",
"description": "",
"sys_updated_on": "2009-01-24 18:33:12",
"sys_tags": "",
"sys_id": "09e9d79f0ab3015000ac88704e680ad4",
"protocol": "UDP",
"sys_updated_by": "glide.maint",
@svfat
svfat / enableswap.sh
Created April 24, 2016 20:37
Enable swapfile
#!/bin/sh
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
sysctl vm.swappiness=10
echo "vm.swappiness=10" >> /etc/sysctl.conf
sysctl vm.vfs_cache_pressure=50
echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.conf
@svfat
svfat / resources_subscription.py
Last active February 21, 2016 13:36
Django TastyPie + dj-stripe API endpoint for subscriptions
from djstripe.models import Customer
from djstripe.settings import CANCELLATION_AT_PERIOD_END
from tastypie import http
def subscription(self, request, **kwargs):
self.method_check(request, ['get', 'post', 'delete'])
if request.user.is_authenticated():
user = request.user
customer = Customer.objects.get(subscriber=user)
if request.method == 'GET':
@svfat
svfat / gist:5f312089da90ae49372c
Last active September 7, 2017 08:33
postgresql create new db
sudo su - postgres
psql
CREATE DATABASE myproject;
CREATE USER myproject WITH PASSWORD 'myproject';
ALTER ROLE myproject SET client_encoding TO 'utf8';
ALTER ROLE myproject SET default_transaction_isolation TO 'read committed';
ALTER ROLE myproject SET timezone TO 'UTC';
ALTER ROLE myproject CREATEDB;
GRANT ALL PRIVILEGES ON DATABASE myproject TO myproject;
\q
@svfat
svfat / gist:c3ca5169f838b3fd9b72
Created July 15, 2015 08:47
django robots.txt in urls
from django.http import HttpResponse
urlpatterns += url(r'^robots.txt$', lambda r: HttpResponse("User-agent: *\nDisallow: /", content_type="text/plain"))
@svfat
svfat / app.js
Created June 16, 2015 13:24
remove hash (sharp) signs from angular ui router URLs
app.config(["$locationProvider", function($locationProvider) {
$locationProvider.html5Mode(true);
}]);