Skip to content

Instantly share code, notes, and snippets.

View yrik's full-sized avatar

Yura Kriachko yrik

View GitHub Profile
PREVPWD=`pwd`
PREVENV_PATH=
PREV_PS1=
PREV_PATH=
handle_virtualenv(){
if [ "$PWD" != "$PREVPWD" ]; then
PREVPWD="$PWD";
if [ -n "$PREVENV_PATH" ]; then
if [ "`echo "$PWD" | grep -c $PREVENV_PATH`" = "0" ]; then
@yrik
yrik / embedly_1.py
Created February 11, 2012 13:59
embed.ly tasks
from math import factorial
for n in range(150, 955):
fact = factorial(n)
print 'len=', len(str(fact))
sum = 0
for s in str(fact):
sum += int(s)
print 'sum=', sum
def get_avatars(backend, details, response, user=None, is_new=False,
*args, **kwargs):
"""Update user details using data from provider."""
if user is None:
return
changed = False # flag to track changes
try:
url = None
if backend.name == 'facebook' and "id" in response:
url = "http://graph.facebook.com/%s/picture?type=large" \
@yrik
yrik / app.py
Created October 7, 2015 09:08
get all django sites in the world
# coding: utf-8
import signal
import time
import socket
import requests
import lxml.html
from urlparse import urlparse
(function() { google.elements.keyboard.loadme({id:"ru",title:"Русская клавиатура",mappings:{sl:{"":'ё!"№;%:?*()_+йцукенгшщзхъ/фывапролджэячсмитьбю,'},l:{"":"Ё1234567890-=ЙЦУКЕНГШЩЗХЪ\\ФЫВАПРОЛДЖЭЯЧСМИТЬБЮ."},
s:{"":'Ё!"№;%:?*()_+ЙЦУКЕНГШЩЗХЪ/ФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,'},"":{"":"ё1234567890-=йцукенгшщзхъ\\фывапролджэячсмитьбю."},sc:{"À=":"Ѣ+","QWERTOPÛÝÜ":"ЇѸѪѬѤЅѮ{}|",
"ASJKL;":"ѲѰѠѾѺѼ",ZXBNM:"ѦѨІѴѶ"},cl:{"À=":"Ѣ+","QWERTOPÛÝÜ":"ЇѸѪѬѤЅѮ[]\\","ASJKL;":"ѲѰѠѾѺѼ",ZXBNM:"ѦѨІѴѶ"},c:{"À=":"ѣ=","QWERTYUIOPÛÝÜ":"їѹѫѭѥңүөѕѯ[]\\","ASJKL;":"ѳѱѡѿѻѽ",ZXBNM:"ѧѩіѵѷ"},scl:{"À=":"ѣ=",
"QWERTYUIOPÛÝÜ":"їѹѫѭѥңүөѕѯ{}|","ASJKL;":"ѳѱѡѿѻѽ",ZXBNM:"ѧѩіѵѷ"}}}); })()
XHR finished loading: GET "http://127.0.0.1:9990/api/lessondivisions?lesson=39"
grid.js:336 ["new", 3]
grid.js:345 end
grid.js:336 ["vry first", 5]
grid.js:345 end
grid.js:336 ["seecond", 6]
grid.js:345 end
grid.js:336 ["seecond", 7]
grid.js:345 end
grid.js:336 ["aaaa111", 8]
@yrik
yrik / test gist
Created September 20, 2018 17:22
This file has been truncated, but you can view the full file.
THE FOUNDATION TRILOGY
ISAAC ASIMOV
Contents
Introduction
Foundation
@yrik
yrik / test gist
Created September 20, 2018 17:22
This file has been truncated, but you can view the full file.
THE FOUNDATION TRILOGY
ISAAC ASIMOV
Contents
Introduction
Foundation
SIC = {
"01": "Crop and animal production, hunting and related service activities",
"02": "Forestry and logging",
"03": "Fishing and aquaculture",
"05": "Mining of coal and lignite",
"06": "Extraction of crude petroleum and natural gas",
"07": "Mining of metal ores",
"08": "Other mining and quarrying",
"09": "Mining support service activities",
"10": "Manufacture of food products",
/*!
* Azure Storage SDK for JavaScript - Blob, 10.3.0
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.azblob = {})));
}(this, (function (exports) { 'use strict';