Skip to content

Instantly share code, notes, and snippets.

View litecreator's full-sized avatar

Marlon Hanks litecreator

View GitHub Profile
pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
@litecreator
litecreator / clone_bitbucket_repos.py
Created March 3, 2018 05:21
Clone all bitbucket repos barely
#!/usr/bin/env python3
'''
Clone all repos from Bitbucket user or team
It assumes you have 'git' and/or 'hg' in your path
usage: clone_bitbucket_repos.py user --login you@example.com
'''
import argparse
import getpass
@litecreator
litecreator / hello.sol
Created January 13, 2019 19:17
The Vapory Hello Contract
pragma solidity ^0.4.18;
contract Hello {
string public message;
function Hello(string initialMessage) public {
message = initialMessage;
}
function setMessage(string newMessage) public {
message = newMessage;
}
}
@litecreator
litecreator / hello.sol
Created January 13, 2019 19:17
The Vapory Hello Contract
pragma solidity ^0.4.18;
contract Hello {
string public message;
function Hello(string initialMessage) public {
message = initialMessage;
}
function setMessage(string newMessage) public {
message = newMessage;
}
}
pragma solidity >=0.4.22 <0.6.0;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
pragma solidity >=0.4.22 <0.6.0;
interface token {
function transfer(address receiver, uint amount) external;
}
contract Crowdsale {
address public beneficiary;
uint public fundingGoal;
uint public amountRaised;
pragma solidity >=0.4.22 <0.6.0;
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
@litecreator
litecreator / Setup GCC and CLANG Toolchains.md
Created December 18, 2020 02:48 — forked from bhaskarvk/Setup GCC and CLANG Toolchains.md
Proper GCC (vers. 5/6/7) & LLVM/CLANG (vers. 4/5) Toolchain Setup on Ubuntu/Linux Mint

This approach uses update-alternatives to manage GCC and LLVM/CLANG C/C++ compiler toolchains. Although tested on Linux Mint 18.3, this approach should work on any Debian based distro or for that matter any Linux distro with update-alternatives support, provided the packages are installed correctly.

There are 3 files

  • gcc-alternatives.sh installs GCC versions 5/6/7 and sets up alternatives for gcc/g++/cpp/gfortran.
  • llvm-clang-alternatives.sh installs LLVM and CLANG versions 4/5 and sets up alternatives for various LLVM and CLANG programs including clang and clang++.
  • cc-alternatives.sh sets up alternatives for the cc, cxx, and the ld commands. This script can be used to change systemwide default compiler/linker combination to either GCC or CLANG.

Once these scripts are run you can change the system GCC/CLANG versions by running sudo update-alternatives --config gcc|clang. To change the default compiler/linker combo used by t

@litecreator
litecreator / headlessvm.md
Created December 22, 2020 23:33 — forked from elasticskyx/headlessvm.md
Run VirtualBox Virtual Machines in Headless Mode #virtualbox #windows #vm

Setup a Headless Virtual Machine on Windows using Oracle VirtualBox

If you are concerned with having many windows open when running several virtual machines on your Windows server or workstation, then have them run headless using VirtualBox commandline tools. Additionally, you can manage these VM's using RDP (Mircrosoft Terminal Server Connection - mstsc.exe) or SSH access (if enabled)

Install VirtualBox and Extension Packs

  • Download the latest version and install of [Oracle VirtualBox] [vbox]
  • Download the [VirtualBox Extension Pack] [vbox] and install for the same version
#!/usr/bin/env sh
# Compiler Alternatives on Ubuntu 20
# Remove all existing alternatives
sudo update-alternatives --remove-all cc
# exit on first error
set -e
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 2