Skip to content

Instantly share code, notes, and snippets.

View eugeneai's full-sized avatar
🏠
Distant worker

Evgeny Cherkashin eugeneai

🏠
Distant worker
View GitHub Profile
(setenv "EPROLOG" "c:/Program Files (x86)/swipl/bin/swipl.exe")
(if (eq window-system 'w32)
(progn
(if (file-directory-p "c:/GNU/bin")
(progn
(add-to-list 'exec-path "c:/GNU/bin")
)
)
(setq url-proxy-services '(("no_proxy" . "172.27.24.")
("http" . "titan.cyber:.......@172.27.100.5:4444")))
#!/usr/bin/env python3
import os
import binascii as ba
EXCEPT=(
".vault",
".exe",
".doc",
".xls",
@eugeneai
eugeneai / gen.py
Created March 18, 2016 07:51
Генераторы
def _(f,*args):
yield f
for a in args:
if type(a)==str:
yield a
else:
# yield from a
for b in a:
yield b
#!/usr/bin/env python
# a bar plot with errorbars
import numpy
import gdal
import matplotlib.pyplot as plt
#import scipy
class Hatch(object):
"""Defines section data consisting of
x1,y1, x2,y2 are points on the section line and
@eugeneai
eugeneai / python.properties
Created January 20, 2016 03:06
Setup for python
# Define SciTE settings for Python files.
file.patterns.py=*.py;*.pyw
file.patterns.scons=SConstruct;SConscript
*source.patterns.python=$(file.patterns.py);
shbang.python=py
filter.python=Python (py pyw)|$(file.patterns.py)|
# Global initialisation file for SciTE
# For Linux, place in $prefix/share/scite
# For Windows, place in same directory as SciTE.EXE (or Sc1.EXE)
# Documentation at http://www.scintilla.org/SciTEDoc.html
#
# https://gist.github.com
# user:eugeneai
# SciTEGlobal.properties python.properties
#
# Globals
@eugeneai
eugeneai / rest-server.py
Created October 17, 2015 20:53 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
#!/bin/env python2
import os, os.path
import pprint
import pickle
def gpg_move():
f=open("find_gpg.log")
for orig in f:
orig = orig.strip()
path = os.path.normpath(orig)
@eugeneai
eugeneai / 00-keyboard.conf
Created July 11, 2015 08:02
Russian keyboard setup in xorg.conf
# /etc/X11/xorg.conf.d/00-keyboard.conf
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us,ru"
Option "XkbModel" "pc104"
Option "XkbVariant" ",winkeys"
Option "XkbOptions" "grp:caps_toggle,grp:alt_shift_toggle,terminate:ctrl_alt_bksp"
EndSection
@eugeneai
eugeneai / sand_wa
Created May 19, 2015 07:18
recursion with sand watch
program lab_10;
uses crt;
const
n=60;
m=16;
var
l,i,a,j,k:integer;
procedure picture1(a,l,t:integer);
begin