Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View zrzka's full-sized avatar
👓
Trying to do something

Robert Vojta zrzka

👓
Trying to do something
View GitHub Profile
- (void)windowDidResize:(NSNotification *)notification {
[self display];
if ( self.hasShadow ) {
[self invalidateShadow];
}
}
/* Remaining time for the next nutrition alarm */
RVRemainingTime=RVUserInterval-Suunto.mod(SUUNTO_DURATION, RVUserInterval);
/* Should we beep? */
if ( SUUNTO_DURATION > 0 && RVRemainingTime == RVUserInterval ) {
/* Decide what we should use */
if ( Suunto.mod( RVAlarmsCounter, RVUserGelCount + RVUserFoodCount ) < RVUserGelCount ) {
/* Use gel */
RVBeepCounter=RVUserGelBeepsCount;
RVGelPrefix=1;
/*
As of 5/13/2013 3:06PM Central Time this script is working. Tweet @runspired to report malfunctions.
*/
/*
Use the Javascript console in Google Chrome and the tcx2nikeplus converter located here: http://www.awsmithson.com/tcx2nikeplus/
This will take some time to run but will port all of your garmin data to nike+.
@zrzka
zrzka / youtrack-workflow.sh
Last active August 29, 2015 14:08
Youtrack Workflow launch script
#!/bin/sh
UNAME=`uname`
SCRIPT_PATH="$0"
if [ "${UNAME}" = "Linux" ]; then
# readlink resolves symbolic links, but on linux only
SCRIPT_PATH=`readlink -f "$0"`
fi
PROJECT_HOME="/Applications/youtrack-workflow.app"
PROJECT_HOME_FROM_STARTUP_DIR=..
@zrzka
zrzka / gist:3ae34814eb597c69bbff
Created December 4, 2014 09:31
Ukázka podepisování requestů
- (NSString *)signatureWithPlainText:(NSString *)plainText key:(NSString *)key {
const char *charKey = [key cStringUsingEncoding:NSASCIIStringEncoding];
const char *charData = [plainText cStringUsingEncoding:NSASCIIStringEncoding];
unsigned char charHMAC[CC_SHA1_DIGEST_LENGTH];
CCHmac( kCCHmacAlgSHA1, charKey, strlen( charKey ), charData, strlen( charData ), charHMAC);
NSData *data = [[NSData alloc] initWithBytes:charHMAC length:sizeof( charHMAC )];
return [data base64EncodedStringWithOptions:0];
@zrzka
zrzka / gist:3f0bd36d095826449850
Created December 4, 2014 11:42
Bezpečnost - 2 - HTTPS - Hooknutí na naši metodu
@import com.saurik.substrate.MS
NSLog_ = dlsym(RTLD_DEFAULT, "NSLog")
NSLog = function() { var types = 'v', args = [], count = arguments.length; for (var i = 0; i != count; ++i) { types += '@'; args.push(arguments[i]); } new Functor(NSLog_, types).apply(null,$
var oldm = {};
MS.hookMessage( ViewController, @selector(signatureWithPlainText:key:), function( text, key ) {
NSLog( @"Text: ->%@<-", text );
NSLog( @"Key: ->%@<-", key );
return oldm->call( this, text, key );
@zrzka
zrzka / main.ir.txt
Created July 9, 2015 16:21
Tuples fun
; ModuleID = '-'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10"
%Si = type <{ i64 }>
%VSs5Int32 = type <{ i32 }>
%VSs20UnsafeMutablePointer = type <{ i8* }>
@_Tv4main9oneSimpleSi = global %Si zeroinitializer, align 8
@_Tv4main8oneTupleSi = global %Si zeroinitializer, align 8
@zrzka
zrzka / prune-old-branches.sh
Created May 31, 2012 14:08
Git - prune remote origin and delete local branches
#!/bin/bash
#
# Written by Robert Vojta <robert@tapmates.com>
#
# This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
#
# http://creativecommons.org/licenses/by-sa/3.0/
#
@zrzka
zrzka / playground.swift
Created October 30, 2015 12:51
Swift - OptionSetType - single option random generator
//: Playground - noun: a place where people can play
import Foundation
struct MathOperation : OptionSetType {
let rawValue: Int
init(rawValue: Int) {
self.rawValue = rawValue
}
@zrzka
zrzka / .travis.yml
Created December 1, 2016 16:38
Broken Trusty Java
- export JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre"
- export JAVA_CMD="/usr/lib/jvm/java-8-oracle/jre/bin/java"
- export PATH="$JAVA_HOME/bin:$PATH"