Skip to content

Instantly share code, notes, and snippets.

View sergey-miryanov's full-sized avatar
💭
Father of the little toddler, may be spontaneously unavailable

Sergey Miryanov sergey-miryanov

💭
Father of the little toddler, may be spontaneously unavailable
View GitHub Profile
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"newline": true,
"segments": [
{
"type": "text",
"style": "plain",
def func():
raise ConnectionError
# 1 вариант - обрабатывает и подавляет исключение
try:
func()
except ConnectionError as exc:
print('exception: ', type(exc), exc)
# получите сообщение:
# exception: <class 'ConnectionError'>
using Serilog;
using Serilog.Core;
using Serilog.Events;
Log.Logger = new LoggerConfiguration()
.WriteTo.Console(formatProvider:new GuidFormatter())
.Destructure.With<GuidDestructuringPolicy>()
.Destructure.ByTransforming<CustomClass>(Helper.ToString)
.Destructure.ByTransforming<CustomStruct>(Helper.ToString)
.CreateLogger();
<#
.SYNOPSIS
Generates a project change log file.
.LINK
Script posted over:
http://open.bekk.no/generating-a-project-change-log-with-teamcity-and-powershell
#>
# Where the changelog file will be created
#$changelogFile = "%system.teamcity.build.tempDir%\changes_%teamcity.build.id%.txt"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using DevExpress.Xpf.Grid;
using GUI.Params.DynamicTable.Impl;
from distutils.core import setup
from distutils.dir_util import copy_tree
from py2exe.build_exe import py2exe
import glob
import os
import zlib
import shutil
import time
import shutil
import enthought.tvtk
@sergey-miryanov
sergey-miryanov / gist:7784273
Last active December 30, 2015 05:39
Sampel of flixel bitmap cache usage
private static function getSpriteImpl(filename : String, width : Float,
resize : IResizeBitmapData) : FlxSprite
{
var key = resize.key(filename, width);
if(!FlxG.bitmap.checkCache(key))
{
if(cacheWarning)
{
trace([filename, key, "Not found"]);
}
package;
import flash.display.Sprite;
class Main extends Sprite {
public function new () {
INRES="1680x1050"
OUTRES="1366x768"
FPS="30"
MAXRATE="1000k"
AUDIOBITRATE="60k"
QUAL="veryfast"
STREAM_KEY="STREAM KEY !!!"
URL="rtmp://live.justin.tv/app/$STREAM_KEY"
avconv -v verbose -f x11grab -show_region 1 -s "$INRES" -r "$FPS" \
@sergey-miryanov
sergey-miryanov / gist:5950067
Created July 8, 2013 15:56
generated c++ file
#include <hxcpp.h>
#ifndef INCLUDED_AnalyticsImpl
#include <AnalyticsImpl.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
Void AnalyticsImpl_obj::__construct()