Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Buidling

Bruno Škvorc Swader

🏠
Buidling
View GitHub Profile
View MyCryptoProfile.md

Linking my account swader on GitHub with my address 5CK8D1sKNwF473wbuBP6NuhQfPaWUetNsWUNAAzVwTfxqjfr on Substrate in mycryptoprofile.io, and the challenge code is: 0460bfdffa715f8b188a01128ad40b39. #LitentryVerifyMyAddress

@Swader
Swader / .gitignore
Last active Mar 4, 2022
ultimate-gitignore
View .gitignore
# Composer
vendor
composer.phar
# IntelliJ - PhpStorm and PyCharm
.idea
*.ipr
*.iws
# Eclipse
@Swader
Swader / demo.php
Created Feb 17, 2014
Mehul Jain's captcha sample
View demo.php
<?php
session_start();
$_SESSION['count'] = time();
$image;
?>
<title>demo.php</title>
<body style="background-color:#ddd; ">
<?php
View punkdrop.txt
5CvcK8o745NwUeLCmEoP4WpDPpB6eKduxR7fV3GtTJCvWysj
5Gdj9n5idJwTjJY5f2QWmrfu5yS57SGGEJt5rsw9UoLuRbYo
5CqULFyV8rgpy3bd3yJGfyFoPrn2EP46vnn86ey4FP5j4nih
5ED1tYzMYqN5pUFeQLNHUKqw9h7t6vrMzdPhiGxjPL4HMHqn
5EgtXK8zsxUu47Zg1ASZF7KzNtWowk6Grp9qEFeVC6C5vgDU
5CZnrJuy9iEYpcSUucTGzzmWvPj9hEicgBxXF3RFTooRXBRa
5HpRcaD8q95mejgSUsyaqbQeczYZcpbLzSvDZYBHj7ZFvtfJ
5Gs3Vmbsr2xaBLCKwTqvUfT511u14QB9jqks2WEsQyWvNvLC
5GbrTYbpLNanZ9c3TjkAURAT91VchpTtE82Vy2mgiex8gqTt
5C89Z5bkp3nAjEcnFFsYxW7b5rj3X3PK38p46zNPYSyWXtQT
View tutexample.md

Sometimes you need to log into a site to get to some walled-off data. Let's see an example.

Let's assume we want to crawl the articles on TheBrowser.com. TheBrowser is a manually curated subscription based website which recommends popular links around the web.

TheBrowser.com

Getting the Login Cookie

Once you have an account on the site you're wanting to crawl (TheBrowser's will cost you some $35 yearly but same procedure applies to any website with a paywall / log in area), log into it.

@Swader
Swader / colors.php
Created Oct 29, 2016
Array of named colors in PHP
View colors.php
// Array of named colors
$namedColors = [
"#000000" => "Black",
"#000080" => "Navy Blue",
"#0000C8" => "Dark Blue",
"#0000FF" => "Blue",
"#000741" => "Stratos",
"#001B1C" => "Swamp",
View claim.rs
use frame_support::{decl_module, decl_storage, decl_event, decl_error, ensure};
use sp_std::vec::Vec;
use system::ensure_signed;
pub trait Trait: system::Trait {
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
}
decl_event! {
pub enum Event<T> where AccountId = <T as system::Trait>::AccountId {
View login.php
</form>
<!-- -------↓↓↓↓ ADD THIS ↓↓↓↓------ -->
<div style="margin-top:10px"><button type="submit" class="btn btn-primary" id="web3login">Log in with Web3</button></div>
<div>
<select name="web3account" id="web3accounts" style="display:none"></select>
<button type="submit" class="btn btn-primary" id="web3loginConfirm" style="display:none">Confirm login</button>
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCb0AVAqC1Bouz25uJVBPAeOqnUlZXid10V3RuQWw3oFLyNDu2JjQ9032IiHcKyZf/FbqBDngCnybCSeMtqZx4dxMGxXrvzkHDW+ZcsdY3k8bLy4RZaKKNgINrBHASsjrn22Oqya5GlkK9/NdcaCxWjmMoy9gbdBAnDD4fYukAEMw7CMKnL9DIfHNp0qykEBSPeM9g7OyZZaHmTscgoCX/nApmkZ3G3ug2XcSwpPLVF0vSLN/Ieutjl1+lUUTkrzBLxPByoG62a0Vgtkn0HRonmO85uXAMH3K46yLlHj6cW4FeIZuIsSlW82TN8S3wBD67nJfhPeM30YQP4I/HdF6H/ swader@ubruntu
View humanRewarder.sol
pragma solidity 0.5.1;
contract HasVoted {
mapping (address => bool) public voted;
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);