Skip to content

Instantly share code, notes, and snippets.

View zulman's full-sized avatar
:octocat:
undefined string

Oleg Chumakov zulman

:octocat:
undefined string
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import traceback
import threading
from telegram.ext import Updater, CommandHandler
def start(bot, update):
s = ""
for line in traceback.format_stack():
s = s + line.strip() +"\n"
/*Функция возвращет объект Date. В нем записано сколько времени до полуночи в часовом поясе пользователя*/
function datetimeUntilMidnight() {
var midnight = new Date();
midnight.setHours( 24 );
midnight.setMinutes( 0 );
midnight.setSeconds( 0 );
midnight.setMilliseconds( 0 );
return ( midnight - new Date() );
}
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.the21.green"
versionCode="10"
version = "1.0.0">
<!-- versionCode is optional and Android only -->
<name>com.the21.green</name>
@zulman
zulman / gist:4958850
Created February 15, 2013 06:32
qsort comparisons test data
| | # of Comparisons with |
| Array | first | last | median |
| | pivot |
|-------------+-------+------+--------|
| 1 | 0 | 0 | 0 |
| 1 2 | 1 | 1 | 1 |
| 1 2 3 | 3 | 3 | 2 |
| 1 2 3 4 | 6 | 6 | 4 |
| 9 6 3 7 2 4 | 11 | 9 | 8 |
| 9 6 3 7 4 2 | 13 | 13 | 9 |
@zulman
zulman / 600213199.txt
Created February 6, 2013 07:39
Test data for counting inversions algorithm. Answer is 600213199.
54044
14108
79294
29649
25260
60660
2995
53777
49689
9083
@zulman
zulman / gist:4072237
Created November 14, 2012 13:57
DL Config
WorkDir = C:\Users\oleg.chumakov\Desktop\AllClients-Starforce-ap9.5.0-tr-TR-56239.9-56294.18756.11-15-12\Castle
ExeName = Castle.exe
AuthServer = http://pw.zzima.com:99/
ProtocolVersion = 0.12.32
Arguments =
[fb]
AppId = 137661392984435
AppSecret = 040c28ebcee0cab600368fd5fbb2bddf
//Current
Action<bool, int> handler = MuteChanged;
if ( handler != null )
handler( mute, secondsLeft );
//Modified
//Action<bool, int> handler = MuteChanged;
if ( MuteChanged != null )
MuteChanged( mute, secondsLeft );
@zulman
zulman / gist:3904361
Created October 17, 2012 08:19
Green static types
//Monster
staticTypes.Object = function() {
this.name = "noname";
this.image = "default.png";
this.bonuses = [];
this.locale = "en";
this.location = "world";
this.packId = "init_pack1";
this.authorName = "noname";
this.authorId = "noname";
@zulman
zulman / gist:3904179
Created October 17, 2012 07:15
OSX input for cyrillic
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
Event e = Event.current;
if (e.isKey)
Debug.Log("Detected character: " + e.character);
}
@zulman
zulman / gist:3831829
Created October 4, 2012 06:33
public show image
var publicShowImage;
$(function() {
// ======================= imagesLoaded Plugin ===============================
// https://github.com/desandro/imagesloaded
// $('#my-container').imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// callback function gets image collection as argument