Skip to content

Instantly share code, notes, and snippets.

@snnwolf
snnwolf / vkcom_audio_downloader (thread, queue).py
Last active August 29, 2015 14:10
Скрипт для скачивания музыки из vk.com. 2 варианта: 1) через нити и очереди; 2) через нити и семафоры. Пожалуй с очередями правильнее!!!
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com)
Запуск:
python vkcom_audio_download.py
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
@snnwolf
snnwolf / coding_console.py
Last active August 29, 2015 14:10
Настройка кодировки консоли и ANSI logging. Взято отсюда http://habrahabr.ru/post/117236/
# -*- coding: utf-8 -*-
import sys
import codecs
import copy
import logging
ansi = not sys.platform.startswith("win")
def setup_console(sys_enc='utf-8', use_colorama=True):
"""
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358558856 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
#= require jquery.ui.sortable
#= require jquery.ui.nestedSortable
#= require sortable_tree/initializer
#= require_self
# case insensitive jQuery Contains http://goo.gl/IrNmk
jQuery.expr[":"].Contains = (a, i, m) ->
jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0
jQuery.expr[":"].contains = (a, i, m) ->
jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0
$ ->
#
# @author Vladimir E <mail@evladimir.com>
#
class Finliner.Models.AmortizationCalculator extends Finliner.Models.BaseModel
available_methods: [
"linear_period" # Линеийный способ (от срока)
"linear_percent" # Линеийный способ (от процента)
"residual_reducing" # Способ уменьшения остатка
"years_amount" # По сумме чисел лет
// Backbone.js 0.9.1
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
//
// HACKED TO BE PROTOTYPE.JS COMPATIBLE BY [SUBIMAGE AT GMAIL DOT COM]
// REQUIRES PROTOTYPE >= 1.7.1
/*
* Copyright (c) 2012-2013 [CodeCatalyst, LLC](http://www.codecatalyst.com/).
* Open source under the [MIT License](http://en.wikipedia.org/wiki/MIT_License).
*/
require( [ 'underscore' ], function ( _ ) {
_.mixin( {
'toQueryString': function ( parameters ) {
var queryString = _.reduce(
parameters,
function ( components, value, key ) {
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
var css = 'insert lots of css here';
var files = {};
css = css.replace(/url\(["']?(\S*)\.(png|jpg|jpeg|gif)["']?\)/g, function(match, file, type)
{
var fileName = file + '.' + type;
var size = fs.statSync(fileName).size;
if (size > 4096) {
console.log('Skipping ' + fileName + ' (' + (Math.round(size/1024*100)/100) + 'k)');
return match;
<?php
/**
* Pull.php:
* Version control your MODX site using git.
* Pulls changes from git and processes database changes in changesets.
*
* Authors:
* Jeroen Kenters / www.kenters.com
* Bert Oost / www.oostdesign.com
*