Skip to content

Instantly share code, notes, and snippets.

View marcelsud's full-sized avatar

Marcelo Santos marcelsud

View GitHub Profile
String file contents
$(cat 1.html)
$(cat 1.html)
@marcelsud
marcelsud / check-tls-version.php
Last active February 15, 2017 00:09
A simple snippet to check the TLS version and ciphers for Realex (https://www.realexpayments.com/support/tls-faq/)
<?php
$recommendedCiphers = [
'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384',
'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384',
];
$supportedCiphers = [
'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256',
'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256',
@marcelsud
marcelsud / ballot.sol
Created October 13, 2018 19:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@marcelsud
marcelsud / ballot_test.sol
Created October 13, 2018 19:12
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.24;
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;