Skip to content

Instantly share code, notes, and snippets.

View zerodivisi0n's full-sized avatar

Alexey Zhuchkov zerodivisi0n

View GitHub Profile
@zerodivisi0n
zerodivisi0n / gist:155353f54f231c6a337e
Created June 21, 2015 11:26
ZeroMQ Getting Started
// Based on http://nichol.as/zeromq-an-introduction
package main
import (
"fmt"
zmq "github.com/pebbe/zmq4"
"log"
"math/rand"
"os"
"strings"
#!/usr/bin/env ruby -w
# My first Ruby program
require "json"
if ARGV.empty?
puts "Usage gpx2json.rb filename"
exit
end
@zerodivisi0n
zerodivisi0n / gist:4309728
Created December 16, 2012 17:15
finding differences of two arrays
NSArray *a = [NSArray arrayWithObjects:@"a", @"c", @"d", @"b", @"k", nil];
NSArray *b = [NSArray arrayWithObjects:@"z", @"a", @"d", @"b", @"m", nil];
NSComparator comparator = ^NSComparisonResult(id obj1, id obj2) {
return [obj1 caseInsensitiveCompare:obj2];
};
NSArray *sortedA = [a sortedArrayUsingComparator:comparator];
NSArray *sortedB = [b sortedArrayUsingComparator:comparator];