Skip to content

Instantly share code, notes, and snippets.

View DarkHole1's full-sized avatar
👁️

Dark Hole DarkHole1

👁️
View GitHub Profile
@DarkHole1
DarkHole1 / json.js
Last active November 18, 2020 08:01 — forked from bubnenkoff/json.json
<script>
var data = [{
"fz": 44,
"registration_number": "0301300020720000004",
"organizer_inn": "0268019693",
"fas_complaints": "False",
"placing_way": "Электронный аукцион",
"lots": {
"lot_number": 1,
"lot_items": [{
@DarkHole1
DarkHole1 / main.d
Created May 18, 2018 16:56 — forked from run-dlang/main.d
Code shared from run.dlang.io.
import std.stdio;
import std.array: split, join;
import std.algorithm.iteration: map;
import std.conv: to;
void main()
{
string s = "635-34-7-3 751-16-2-1-1 224-16-4-1-1 625-11-3-1-1 231-16-4-2-1-1 212-7-3-2-1 603-19-5-2-2 624-27-6-3-1-1 663-28-1 600-27-3-2-1-1 102-12-4";
string alph = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz{}";
string res = s.split(' ').map!("a.split('-').map!(\"a.to!int\").fold!\"a + b * b\"(0)").map!((a) => [alph[a / 10000], alph[a % 10000 / 100], alph[a % 100]]).join("");
writeln(res);
@DarkHole1
DarkHole1 / main.d
Created May 18, 2018 16:32 — forked from run-dlang/main.d
Code shared from run.dlang.io.
import std.stdio;
void main()
{
string s = "dhctf{54nc7u5_c4n7_d3c1ph3r_7h15}";
string alph = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz{}";
string res;
auto n = 0;
for(auto i = 0; i < s.length; ++i) {
auto j = 0;
for(; j < alph.length; ++j) if(s[i] == alph[j]) break;