Skip to content

Instantly share code, notes, and snippets.

View fortunto2's full-sized avatar

Rustam Salavatov fortunto2

View GitHub Profile
@gumeniukcom
gumeniukcom / gist:1358881
Created November 11, 2011 19:03
Работа со списками в Python
# Создание списков
List = [] # пустой список
List = [ 'hello', 5, [1,2,3] ] # список с вложенным списком
List[i] # индекс
@4poc
4poc / gist:1565186
Created January 5, 2012 13:06
ffmpeg / mpeg-ts / m3u8 / HLS
ffmpeg \
-i INPUT_FILE \
-re \
-r 23.976 \
-s 480x204 \
-aspect 2.35 \
-acodec libfaac \
-ac 2 \
-ar 44100 \
-ab 128k \
@dougalcampbell
dougalcampbell / phpfpm-mon.cron
Created February 14, 2012 19:45
Crontab entry to monitor for php-fpm problems
## Auto-restart PHP when it's returning errors
#
# Make sure that http://localhost/test.php is an actual PHP script. If it starts returning
# 500 errors, restart the PHP-FPM service
* * * * * /usr/bin/curl --head -sf http://localhost/test.php -o /dev/null || /usr/sbin/service php5-fpm restart
@williamratcliff
williamratcliff / forms.py
Created March 14, 2012 08:55 — forked from maraujop/forms.py
django-crispy-forms bootstrap form example
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class MessageForm(forms.Form):
text_input = forms.CharField()
@christianhanvey
christianhanvey / modx-snippets.php
Last active December 8, 2024 18:46
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@justinfx
justinfx / enc_dec_test.py
Last active October 16, 2022 13:28
Speed test of common serializers on python 2.7.2 (pickle, cPickle, ujson, cjson, simplejson, json, yajl, msgpack)
"""
Dependencies:
pip install tabulate simplejson ujson yajl msgpack
"""
from timeit import timeit
from tabulate import tabulate
setup = '''d = {
'words': """
@w495
w495 / автоматическая классификация видео — обзор литературы.md
Created December 2, 2012 22:13
автоматическая классификация видео — обзор литературы

ieee transactions on systems, man, and cybernetics, vol. unknown, no. unknown, unknown 2007 Automatic Video Classification: A Survey of the Literature Darin Brezeale and Diane J. Cook, Senior Member, IEEE

АВТОМАТИЧЕСКАЯ КЛАССИФИКАЦИЯ ВИДЕО — ОБЗОР ЛИТЕРАТУРЫ

Сегодня много видео доступно. Работа над методами автоматической классификацией видео началась,

@thomaspark
thomaspark / subnav.css
Last active April 27, 2025 16:39
Subnav for Bootstrap 2
section {
padding-top: 60px;
}
.subnav {
margin-bottom: 60px;
width: 100%;
height: 36px;
background-color: #eeeeee; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
@schwuk
schwuk / flatpage_mixin.py
Last active September 23, 2017 20:44
Django class-based view(CBV) mixin to include flatpage content in the context.
from django.contrib.flatpages.models import FlatPage
class FlatPageMixin(object):
"""
Retrieves the FlatPage object for the specified url, and includes it in the
context.
If no url is specified, request.path is used.
"""
@mikermcneil
mikermcneil / mpu-s3-from-another-url.js
Created March 12, 2013 06:33
multi-part s3 streaming upload from another url
var fs = require('fs');
var knox = require('knox');
var mpu = require('knox-mpu');
var request = require('request');
var uri = "https://lh4.ggpht.com/N5f6FA5zPjrTH-UggaFLstYSO1za-01CbsO17ZwkghtF0k9TSzWcnCn4bybCDeIOP4cu=w124";
// Open download stream from google
var downStream = request(uri);