This file contains 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
const array = [...new Array(10000,)].map((_,i) => i); |
This file contains 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
/** | |
* Utility function to convert seconds to an iso8601 duration string. | |
* | |
* @param seconds int The number of seconds to encode. | |
* @return string iso8601 formatted duration | |
*/ | |
const iso8601Duration = (seconds = 0) => { | |
let _seconds = seconds; |
This file contains 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
alias jira='open "http://jira-host.com/browse/$(git rev-parse --abbrev-ref HEAD)"' |
This file contains 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
{ | |
"scripts": { | |
"compress:js:components": "find dist/components/*.js -type f -exec basename {} .js \\; | xargs -I '{}' uglifyjs --compress --mangle --output dist/components/{}.min.js -- dist/components/{}.js", | |
} | |
} |
This file contains 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
const input = 'abc' | |
const inputLength = 3 | |
const powerSetSize = Math.pow(2, inputLength) | |
let result = [] | |
for (let k = 0; k < powerSetSize; k++) { | |
let set = ""; | |
let binaryDigits = k; | |
for (let j = 0; j < inputLength; j++) { |
This file contains 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
func copyDatabaseIfNeeded() { | |
// Move database file from bundle to documents folder | |
let fileManager = FileManager.default | |
let documentsUrl = fileManager.urls(for: .documentDirectory, | |
in: .userDomainMask) | |
guard documentsUrl.count != 0 else { | |
return // Could not find documents URL |
This file contains 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
'use strict' | |
angular.module('ip') | |
.directive('draggable', ($document) -> | |
restrict: "EA" | |
link: (scope, element, attr) -> | |
pos_y = pos_x = drg_h = drg_w = 0 | |
This file contains 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
#include <iostream> | |
#include <cstring> | |
#include <array> | |
using namespace std; | |
const std::array<char, 27> alpha = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}; | |
const std::array<std::array<char, 27>, 3> rotors | |
{ | |
{{"EKMFLGDQVZNTOWYHXUSPAIBRCJ"}, | |
{"AJDKSIRUXBLHWTMCQGZNPYFVOE"}, |
This file contains 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
#!/usr/bin/perl | |
$|=1; #disable output buffering, this is necessary for proper output through pipe | |
my @rotors = ('EKMFLGDQVZNTOWYHXUSPAIBRCJ','AJDKSIRUXBLHWTMCQGZNPYFVOE','BDFHJLCPRTXVZNYEIWGAKMUSQO'); | |
my $reflector = "YRUHQSLDPXNGOKMIEBFZCWVJAT"; | |
my $key = "ABC"; | |
sub li { |
This file contains 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
#!/usr/bin/env python | |
import string | |
_rotors = [ 'EKMFLGDQVZNTOWYHXUSPAIBRCJ', | |
'AJDKSIRUXBLHWTMCQGZNPYFVOE', | |
'BDFHJLCPRTXVZNYEIWGAKMUSQO' | |
] | |
_reflector = "YRUHQSLDPXNGOKMIEBFZCWVJAT" | |
_key = "ABC" |
NewerOlder