This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const combine = (arrays: string[][]) => { | |
| // computing the total count of all combinations | |
| let totalCount = arrays.reduce((count, array) => count * array.length, 1); | |
| // initialize the result array | |
| const result = new Array(totalCount); | |
| for (let i = 0; i < totalCount; i++) { | |
| result[i] = ''; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Temporarily test current edits on Heroku | |
| # https://rhodesmill.org/brandon/2012/quietly-pushing-to-heroku/ | |
| set -e | |
| git add . | |
| git commit -m 'Heroku temporary commit' | |
| git push heroku master --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.ComponentModel.Composition; | |
| using Microsoft.VisualStudio.Shell; | |
| using Microsoft.VisualStudio.Shell.TableManager; | |
| public class ExtensionPackage : Package | |
| { | |
| [Import] | |
| private ITableManagerProvider _tableManagerProvider; | |
| protected override void Initialize() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template<int Min, int Max> class RestrictedInt { | |
| private: | |
| int value; | |
| explicit RestrictedInt(int val) : value(val) {} | |
| public: | |
| int GetValue() const { return value; } | |
| template<int Value> static RestrictedInt CreateObject() { | |
| static_assert(Value >= Min && Value <= Max, "ResctrictedInt: value is out of range!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket | |
| ; Is n a happy number. | |
| (define (isHappy n) | |
| ; returns i squared. | |
| (define (square i) (* i i)) | |
| ; returns the last digit in n. | |
| (define (getLastDigit n) (modulo n 10)) | |
| ; returns n with the last digit omitted. | |
| (define (omitLastDigit n) (truncate (/ n 10))) | |
| ; returns the square of the last digit in n. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class GZipper | |
| { | |
| private const int BUFFER_SIZE = 64 * 1024; | |
| public static byte[] Compress(byte[] data) | |
| { | |
| if (data == null) | |
| throw new ArgumentNullException("data", "data can't be null!"); | |
| byte[] result; |
NewerOlder