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
gem 'angularjs-rails' | |
gem 'chart-js-rails' |
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> | |
using namespace std; | |
char alpha[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
char rotors[3][27] = | |
{ | |
"EKMFLGDQVZNTOWYHXUSPAIBRCJ", | |
"AJDKSIRUXBLHWTMCQGZNPYFVOE", | |
"BDFHJLCPRTXVZNYEIWGAKMUSQO" |
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'; | |
enigma = (function() { | |
var _rotors = [ 'EKMFLGDQVZNTOWYHXUSPAIBRCJ', | |
'AJDKSIRUXBLHWTMCQGZNPYFVOE', | |
'BDFHJLCPRTXVZNYEIWGAKMUSQO' | |
] | |
, _reflector = "YRUHQSLDPXNGOKMIEBFZCWVJAT" | |
, _alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
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" |
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
#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
'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
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
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
{ | |
"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", | |
} | |
} |