Skip to content

Instantly share code, notes, and snippets.

View z5ottu's full-sized avatar
👾
hopeful

Szloboda Zsolt z5ottu

👾
hopeful
View GitHub Profile
@z5ottu
z5ottu / uibutton.3d.transform.swift
Created January 4, 2016 11:40
Swift: UIView 3d transform animation style: horizontal flip
let layer = sender.layer
var rotationAndPerspectiveTransform : CATransform3D = CATransform3DIdentity
rotationAndPerspectiveTransform.m34 = 1.0 / -1000
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, CGFloat(M_PI / 0.3), 0.0, 1.0, 0.0)
layer.transform = rotationAndPerspectiveTransform
UIView.animateWithDuration(2.0, animations: {
layer.transform = CATransform3DIdentity
})
//
// CustomTab.m
//
// Created by z5ottu Szloboda Zsolt on 10/02/16.
// Copyright © 2016 z5 tech. All rights reserved.
//
// compatibility: ios8, ios9
#import <Foundation/Foundation.h>
#import "CustomTab.h"
@z5ottu
z5ottu / CustomTab.h
Last active February 11, 2016 09:45
//
// CustomTab.h
//
// Created by z5ottu Szloboda Zsolt on 10/02/16.
// Copyright © 2016 z5 tech. All rights reserved.
//
// compatibility: ios8, ios9
#ifndef CustomTab_h
#define CustomTab_h
#import 

SomeClass * t = [[SomeClass alloc] init];
int i=0;
unsigned int mc = 0;
Method * mlist = class_copyMethodList(object_getClass(t), &mc);
defmodule ErlEC2 do
# elixir aws ec2 run instances ami
# source: http://donpflaster.net/2016/02/09/controlling-amazon-ec2-instances-with-elixir/
require Record
Record.defrecord :ec2_instance_spec, Record.extract(:ec2_instance_spec, from: "deps/erlcloud/include/erlcloud_ec2.hrl")
@image_id 'ami-xxxxxxxx'
def start_instances(aws_ids) do
// Arduino YM2149 MIDI Synth
// by yukimizake
// video: https://youtu.be/hUPs2pv5d_g
// schematics: http://electronicfields.wordpress.com/?attachment_id=128 (Vcc/GND not shown)
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
@z5ottu
z5ottu / riak_kv_vnode.erl
Created May 15, 2018 19:05 — forked from bowrocker/riak_kv_vnode.erl
riak_kv_vnode.erl changes to compile with YZ merge problem
%% -------------------------------------------------------------------
%%
%% riak_kv_vnode: VNode Implementation
%%
%% Copyright (c) 2007-2010 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
#!/bin/bash
# ERL_BIN, RIAK_LIB, and BUCKET_LIB can be defaulted here or set
# in the environment
#
# Path to the erl binary provided by Riak
ERL_BIN=${ERL_BIN:-"/usr/lib64/riak/erts-5.8.4/bin/erl"}
# Path to riak libraries
RIAK_LIB=${ERL_BIN:-"/usr/lib64/riak/lib"}
handle_call({lookup_popular_replies, TweetId, AuthorId}, _From, #state{client=Client} = State) ->
% reduce fun to get valid tweet keys in tweet response bucket phase 3
Fun = make_local_fun("fun(O, _) ->
lists:foldl(fun
([LinkedTweet = <<Id:128>>, <<Val:128>>, <<\"reply\">>], Acc) ->
[{{<<\"tweet_responses_bucket\">>, LinkedTweet}, {Id, Val}} | Acc];
({{<<\"tweet_responses_bucket\">>, _}, _} = PreviousPass, Acc) ->
[PreviousPass | Acc];
(_, Acc) ->
Acc
#!/usr/bin/env escript
%% -*- erlang -*-
-include_lib("kernel/include/file.hrl").
-compile(export_all).
-define(LOG(S), io:format(S)).
-define(LOG(S,A), io:format(S,A)).
main(Dirs) ->
CodePath = case os:getenv("RIAK_LIB") of