Skip to content

Instantly share code, notes, and snippets.

View mbykovskyy's full-sized avatar

Maksym Bykovskyy mbykovskyy

View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@mbykovskyy
mbykovskyy / gist:92b011bbdd97ce953907
Last active August 29, 2015 14:09
Generating Certificates
# Root CA
openssl genrsa -out root/root.key 2048
openssl req -x509 -new -nodes -key root/root.key -out root/root.crt -sha256 -days 36500
# Intermediate CA
openssl genrsa -out inter/inter.key 2048
openssl req -new -key inter/inter.key -out inter/inter.csr -config ca/conf/caconfig.cnf
openssl ca -keyfile root/root.key -cert root/root.crt -extensions v3_ca -in inter/inter.csr -out inter/inter.crt -notext -md sha256 -config ca/conf/caconfig.cnf -days 36500
# Host Cert
@mbykovskyy
mbykovskyy / ember_cli_vulcanize.md
Last active August 29, 2015 14:06
Some issues that need to be considered

Scenario: Imports not included in a file

<!-- foo.hbs -->
<bounce-animation></bounce-animation>
  • Where this component comes from polymer_components or bower_components?
  • What about components that live in files with identical names? For example, cool-animations/bounce-animation.html and my-animations/bounce-animation.html
@mbykovskyy
mbykovskyy / dd_to_dms.js
Created August 22, 2014 03:31
Convert decimal degrees to degrees minutes seconds.
/**
* Converts decimal degrees to degrees minutes seconds.
*
* @param dd the decimal degrees value.
* @param isLng specifies whether the decimal degrees value is a longitude.
* @return degrees minutes seconds string in the format 49°15'51.35"N
*/
function convertToDms(dd, isLng) {
var dir = dd < 0
? isLng ? 'W' : 'S'
@mbykovskyy
mbykovskyy / vssln.rb
Created June 19, 2013 10:42
A hacky, incomplete Microsoft Visual Studio Solution parser
require 'stringio'
module VSSLN
class Solution
def add_project project
@projects ||= {}
@projects[project.guid] = project
end
def remove_project project
@mbykovskyy
mbykovskyy / sums_of_elements.java
Created August 5, 2011 08:49
An algorithm for generating all possible combinations of sums of elements.
public List<Integer> sums(int sum, int offset, int[] array) {
List<Integer> sums = new ArrayList<Integer>(array.length - offset);
for (int i = offset; i < array.length; ++i) {
int total = sum + array[i];
sums.add(total);
sums.addAll(sums(total, i + 1, array));
}
@mbykovskyy
mbykovskyy / power_of_two.java
Created August 5, 2011 08:48
Handy methods for working with power of two values.
public int nextPowerOfTwo(int value) {
return 1 << 32 - Integer.numberOfLeadingZeros(value - 1);
}
public int previousPowerOfTwo(int value) {
return 1 << 31 - Integer.numberOfLeadingZeros(value);
}
public boolean isPowerOfTwo(int value) {
return (value & -value) == value;