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
import std.file : read; | |
import std.stdio; | |
import std.base64; | |
import std.string; | |
import std.conv; | |
import std.algorithm : map; | |
enum DerTag { | |
EndOfContent = 0x0, | |
Bool = 0x1, |
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 dmd -run | |
import std.range; | |
struct Words(R,int maxWordLen = 4) | |
{ | |
int wordLen; | |
R inner; | |
dchar[maxWordLen] buffer; | |
this(R inner) { | |
this.inner = inner.save;//refRange(&inner); | |
foreach (ref d; buffer) { |
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
#define MOTOR_L_F 6 | |
#define MOTOR_L_B 5 | |
#define MOTOR_R_B 9 | |
#define MOTOR_R_F 10 | |
#define SENSOR_L 11 | |
#define SENSOR_F 12 | |
void left(int speed) | |
{ |
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
// Copyright Lionello Lunesu, placed in the public domain. | |
import std.algorithm; | |
import std.range; | |
ubyte charCode(dchar c) pure { | |
switch (c) { | |
case '<': return 0; | |
case 'A': .. case 'Z': return cast(ubyte)(c - 'A' + 10); | |
case '0': .. case '9': return cast(ubyte)(c - '0'); | |
default: assert(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
#!/usr/bin/env node | |
const FS = require('fs') | |
const Path = require('path') | |
const FolderMap = { | |
"1x": "mipmap-mdpi", | |
"2x": "mipmap-xhdpi", | |
"3x": "mipmap-xxhdpi", | |
} |
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
import std.xml; | |
import std.file; | |
import std.stdio; | |
import std.conv; | |
import std.math; | |
real EPSILON = 1e-2; | |
real distance_to_line(real fx, real fy, real tx, real ty, real px, real py) { |
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 dmd -run | |
import std.xml; | |
import std.file; | |
import std.stdio; | |
Element getElementByTagName(Element parent, string name) { | |
foreach (child; parent.elements) { | |
if (child.tag.name == name) { | |
return child; |
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
pragma solidity ^0.4.17; | |
contract ModExp { | |
// Wrapper for built-in bigint_modexp (contract 0x5) as described here https://github.com/ethereum/EIPs/pull/198 | |
function modexp(bytes memory _base, bytes memory _exp, bytes memory _mod) public view returns(bytes memory ret) { | |
uint256 bl = _base.length; | |
uint256 el = _exp.length; | |
uint256 ml = _mod.length; |
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 bash | |
# Source: https://gist.github.com/lionello/6bb597fc600932c6c737aab3b402147c | |
ignore=0 | |
decode=0 | |
dashdash=0 | |
args=() | |
files=() | |
while [ $# -gt 0 ]; do |
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 node | |
const Child_process = require('child_process') | |
const Web3 = require('web3') | |
const Assert = require('assert') | |
const SOL = ` | |
contract BS { | |
function isValidSignature( | |
address signer, | |
bytes32 hash, |