Skip to content

Instantly share code, notes, and snippets.

@kolyuchiy
kolyuchiy / gist:3281b68e82f6aaacd0c8a33d94bc25b4
Created September 14, 2016 15:30
Example launch events log
load 0 0
main 44 44
did finish launching 295 250
did init BIOD 489 194
will load accounts 1145 655
ELVC view did appear 1663 518
did load accounts 1933 269
did load cached folders 2075 142
items from cache 5547 3471
ELVC did show initial items 7146 1599
@kolyuchiy
kolyuchiy / gist:05d28e6a78f876a815c20bcd03d705de
Created September 14, 2016 15:23
Example of DYLD_PRINT_STATISTICS output
total time: 2.1 seconds (100.0%)
total images loaded: 309 (304 from dyld shared cache)
total segments mapped: 14, into 2352 pages with 140 pages pre-fetched
total images loading time: 842.08 milliseconds (39.3%)
total dtrace DOF registration time: 0.19 milliseconds (0.0%)
total rebase fixups: 310,006
total rebase fixups time: 51.52 milliseconds (2.4%)
total binding fixups: 376,990
total binding fixups time: 598.68 milliseconds (27.9%)
total weak binding fixups time: 6.55 milliseconds (0.3%)
// ==UserScript==
// @name Почта mail.ru
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://e.mail.ru/*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
#!/usr/bin/env perl
use strict;
use warnings;
use autodie qw(:all);
my $str = do { local $/; <STDIN> };
$str =~ s/[^0-9a-fA-F]//gm;
$str = pack('H*', $str);
//
// ObjectsSnapshot.m
// MRMail
//
// Created by Nikolay Morev on 02/02/16.
// Copyright © 2016 Mail.Ru. All rights reserved.
//
#import "ObjectsSnapshot.h"
#include <stdio.h>
@kolyuchiy
kolyuchiy / gist:17611ac0d022be45c633
Last active October 25, 2016 10:05
Tampermonkey script for gerrit
// ==UserScript==
// @name Gerrit code CSS
// @namespace https://gist.github.com/kolyuchiy/17611ac0d022be45c633
// @version 0.1
// @description enter something useful
// @author You
// @match http://johann.mail.msk:8081/
// @grant none
// ==/UserScript==
@kolyuchiy
kolyuchiy / gist:9827218
Created March 28, 2014 07:28
Core Data Transaction-like Method
- (BOOL)performBlockAndSaveOrReset:(BOOL (^)(NSError *__autoreleasing *))block error:(NSError *__autoreleasing *)error
{
__block BOOL blockOk, saveOk;
__block NSError *blockError, saveError;
[self performBlockAndWait:^{
blockOk = block(&blockError);
if (! blockOk) {
[self reset]; return;
}
@kolyuchiy
kolyuchiy / gist:7152637
Created October 25, 2013 10:29
Read from file using dispatch_source
int rc = 0;
void *opaque = myfile_alloc();
const char *incomplete_movie_filename = [[self.incompleteMovieAsset.movieURL path] cStringUsingEncoding:NSASCIIStringEncoding];
rc = myfile_open(opaque, incomplete_movie_filename);
if (rc < 0) {
if (error) *error = [NSError errorWithFFStatus:rc];
return NO;
}
@kolyuchiy
kolyuchiy / gist:7152532
Last active December 26, 2015 12:39
Read from file ignoring EOF
int myfile_read_buffer(void *opaque, uint8_t *buf, int buf_size)
{
MyFileContext *file = opaque;
FILE *fd = file->file;
void *b = malloc(buf_size);
size_t bytes_left = buf_size;
size_t total_bytes_read = 0;
void *p = b;
@kolyuchiy
kolyuchiy / sxekicker.sma
Created November 19, 2011 21:36
Скрипт для AMX Mod X, выбрасывающий с сервера юзеров без античита при условии, что на сервере играет больше заданного количества пользователей
#include <amxmodx>
#define PLUGIN_NAME "NO-sXe-I Kicker"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "Kolia"
// kick reasons
new const g_kick_reason[] = "ycTaHoBu AHTu4uT freedomnet.ru/sxe.exe"