Skip to content

Instantly share code, notes, and snippets.

View nikolaykasyanov's full-sized avatar

Nikolai Kasyanov nikolaykasyanov

  • JetBrains
  • Berlin, Germany
View GitHub Profile
find . -name '*.p12' -depth 1 -type f | sed 's/^\.\/\(.\)/\1/' | xargs -I '{}' openssl pkcs12 -passin 'pass:' -in '{}' -out '{}'.pem -nodes
@nikolaykasyanov
nikolaykasyanov / update-all-profiles.sh
Last active August 29, 2015 13:56
Script for updating Apple provisioning profiles. Can be used on CI servers like Jenkins.
#!/bin/sh
function fetchProvisioningProfiles()
{
ios profiles:download:all --type development
DEVELOPMENT_RESULT=$?
if [ "$DEVELOPMENT_RESULT" -ne "0" ]; then
return 1
fi
@nikolaykasyanov
nikolaykasyanov / deployment-target-patch.diff
Last active December 30, 2015 18:28
Patches to be used with Ogre homebrew formula
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -237,10 +237,15 @@
remove_definitions(-msse)
elseif (APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
- # Set 10.5 as the base SDK by default
+ # Set 10.6 as the base SDK by default
set(XCODE_ATTRIBUTE_SDKROOT macosx)
@nikolaykasyanov
nikolaykasyanov / LICENSE.txt
Last active December 27, 2015 18:39
Script for Jenkins CI that extracts annotation of most recent annotated tag to file. This file then can be used as a release notes for TestFlight/HockeyApp deployment. Scriptler plugin is required.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@nikolaykasyanov
nikolaykasyanov / Ogre.patch
Created October 23, 2013 05:12
Patch for Ogre 1.8.1 release that add compatibility with recent Xcode versions.
# HG changeset patch
# User Nikolay Kasyanov <corrmage@gmail.com>
# Date 1375029954 -14400
# Branch v1-8
# Node ID 37b1f1b3c594019b2131828ae7d942f53d6a4738
# Parent 525a7f3bcd4e51b1085c42a8b55fe07eb7700458
Fix build on CMake >= 2.8.10
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
@nikolaykasyanov
nikolaykasyanov / rotation.m
Last active December 21, 2015 20:58
Rotation handling in reactive style. Kinda complex =\
RACSignal *contentOffsetSignal = RACObserve(webView.scrollView, contentOffset);
RACSignal *contentSizeSignal = RACObserve(webView.scrollView, contentSize);
RACSignal *willRotateSignal = [self rac_signalForSelector:@selector(willRotateToInterfaceOrientation:duration:)];
// Sends @YES everytime orientation changes from portrait to landscape or vice-versa.
// will not send anything if changed from portrait to portrait upside down, for example.
RACSignal *orientationTypeChangedSignal = [[[willRotateSignal map:^(RACTuple *value) {
return value.first;
}] combinePreviousWithStart:@(self.interfaceOrientation)
@nikolaykasyanov
nikolaykasyanov / speedtest.html
Created December 3, 2012 18:23
speed test csv visualization
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SpeedTest results visualizer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="http://api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU"
type="text/javascript"></script>
<script type="text/javascript">
ymaps.ready(init);
@nikolaykasyanov
nikolaykasyanov / jpeg_memory_src.c
Created October 24, 2012 14:07
Memory source for libjpeg-turbo
#include "jpeg_memory_src.h"
/// JPEG source manager
struct jpeg_source_t
{
struct jpeg_source_mgr _pub;
const char *_begin;
const char *_end;
};
"account_playback_token=&ptk=youtube_none&url_encoded_fmt_stream_map=itag%3D46%26url%3Dhttp%253A%252F%252Fo-o---preferred---sn-ug5onuxaxjvh-bvwe---v8---lscache5.c.youtube.com%252Fvideoplayback%253Fupn%253DSQMnQ9oKXO4%2526sparams%253Dcp%25252Cid%25252Cip%25252Cipbits%25252Citag%25252Cratebypass%25252Csource%25252Cupn%25252Cexpire%2526fexp%253D927104%25252C922401%25252C920704%25252C912806%25252C927201%25252C913546%25252C913556%25252C925109%25252C919003%25252C920201%25252C912706%25252C900816%25252C911112%2526key%253Dyt1%2526expire%253D1350508691%2526itag%253D46%2526ipbits%253D8%2526sver%253D3%2526ratebypass%253Dyes%2526mt%253D1350485115%2526ip%253D92.39.71.38%2526mv%253Dm%2526source%253Dyoutube%2526ms%253Dau%2526cp%253DU0hURVVLVl9OS0NONF9NRVpHOkkybnNvUGlzSklW%2526id%253D2323a7d3a187aea3%2526newshard%253Dyes%26type%3Dvideo%252Fwebm%253B%2Bcodecs%253D%2522vp8.0%252C%2Bvorbis%2522%26fallback_host%3Dtc.v5.cache3.c.youtube.com%26sig%3D513888ED3EBFEAD1CDB51FF678DB1B3108D90EA6.0C0E9B97CE04CA922D76BED346E7381E7848F225%2
@nikolaykasyanov
nikolaykasyanov / backtrace
Created September 19, 2012 21:40
Launcher crash without existing config files in OpenMW 0.18 rc
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x96997a6a __pthread_kill + 10
1 libsystem_c.dylib 0x905abacf pthread_kill + 101
2 libsystem_c.dylib 0x905e24f8 abort + 168
3 libc++abi.dylib 0x9847180c abort_message + 151
4 libc++abi.dylib 0x9846f275 default_terminate() + 34
5 libc++abi.dylib 0x9846f2b5 safe_handler_caller(void (*)()) + 13
6 libc++abi.dylib 0x9846f31d std::terminate() + 23
7 libc++abi.dylib 0x9847049e __cxa_rethrow + 83
8 omwlauncher 0x0005cbb9 boost::program_options::store(boost::program_options::basic_parsed_options<char> const&, boost::program_options::variables_map&, bool) + 617 (variables_map.cpp:79)