Skip to content

Instantly share code, notes, and snippets.

View zbrox's full-sized avatar

Rostislav zbrox

View GitHub Profile
@zbrox
zbrox / Dockerfile
Last active June 24, 2020 16:55
Minimal Docker image template for static Rust binaries supporting SSL encrypted networking
# This image is made for building static binaries linked against musl
# It includes OpenSSL compiled against musl-gcc
# I think clux/muslrust:latest uses nightly
FROM clux/muslrust AS build
WORKDIR /usr/src
# Update CA Certificates
RUN apt update -y && apt install -y ca-certificates
RUN update-ca-certificates
@zbrox
zbrox / uicolorFromHex.swift
Last active August 29, 2015 14:05 — forked from shadcn/gist:de147c42d7b3063ef7bc
Create a UIColor instance from a HEX colour definition (as of Swift beta 4)
func colorWithHexString (hex:String) -> UIColor {
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString
if (cString.hasPrefix("#")) {
cString = cString.substringFromIndex(advance(cString.startIndex, 1))
}
if (countElements(cString) != 6) {
return UIColor.grayColor()
}
@zbrox
zbrox / keybase.md
Last active February 5, 2016 13:22

Keybase proof

I hereby claim:

  • I am zbrox on github.
  • I am zbrox (https://keybase.io/zbrox) on keybase.
  • I have a public key ASBV7tsIViibbe2ouMUqyiqyv4wD61A0G49t5dsYZbqrhwo

To claim this, I am signing this object:

@zbrox
zbrox / iso_array.php
Last active December 22, 2015 14:38 — forked from brianherbert/iso_array.php
ISO 3166-1 alpha-3 countries list as a PHP array sorted by country name, not country code. I've added Scotland (SCO) and England (ENG), because for the purpose I needed it I couldn't go with just Great Britain (GB).
<?php
$iso_array = array (
'AFG' => 'Afghanistan',
'ALB' => 'Albania',
'DZA' => 'Algeria',
'ASM' => 'American Samoa',
'AND' => 'Andorra',
'AGO' => 'Angola',
'AIA' => 'Anguilla',
'ATA' => 'Antarctica',
hr {
height: 3px;
border: 0;
background-color: #c3c3c3;
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#f7f6f4), to(#f7f6f4), color-stop(50%, #fff));
background-image: -webkit-linear-gradient(left, #f7f6f4, #fff, #f7f6f4);
background-image: -moz-linear-gradient(left, #f7f6f4, #fff, #f7f6f4);
background-image: -ms-linear-gradient(left, #f7f6f4, #fff, #f7f6f4);
background-image: -o-linear-gradient(left, #f7f6f4, #fff, #f7f6f4);
}
@zbrox
zbrox / qlmanage.sh
Created February 27, 2013 21:19
Convert a SVG file to a 1000px wide PNG under Mac OS X
qlmanage -t -s 1000 -o . picture.svg
@zbrox
zbrox / convert_rt90_to_wgs84.rb
Created February 27, 2013 21:17
Convert a GeoJSON file from RT90 (Swedish standard) coordinate system to WGS84
require 'rubygems'
require 'json'
require "swedishgrid"
def convert(coords)
grid = SwedishGrid.new(:rt90)
reversed = grid.grid_to_geodetic(coords[1], coords[0])
[reversed[1], reversed[0]]
end
@zbrox
zbrox / Gemfile
Created September 13, 2012 18:53
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin