Skip to content

Instantly share code, notes, and snippets.

View MicrowaveDev's full-sized avatar

Microwave Dev MicrowaveDev

View GitHub Profile
@MicrowaveDev
MicrowaveDev / ImageToInstagramController.php
Last active January 6, 2023 19:09
Laravel Intervention Image place to square for instagram(fill background, vertical or horizontal align a image) plus blur option.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AdminController extends Controller
{
public function imageFillToSquare(Request $request){
@MicrowaveDev
MicrowaveDev / hashparty-add-payments-hours.js
Last active December 29, 2017 21:04
Hashparty add hours column and "per hour" caption to payments
//PASTE THIS TO BROWSER CONSOLE(F12) AND EXECUTE(ENTER)
//RESULT: https://pasteboard.co/H0vltKF.jpg
var payments = [];
$('#payments_rows').find('tr').each(function(){
var $tr = $(this);
var dateStr = $tr.find('td').first().html().replace(/,/g, '');
var amountStr = $tr.find('td:nth-child(3)').first().html();
payments.unshift({date: new Date(dateStr), amount: parseFloat(amountStr), el: $tr});
})
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello IPFS!</title>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<h1>Hello IPFS! Look at this cute cat.jpeg</h1>
<img src="./cat.jpeg"/>
@MicrowaveDev
MicrowaveDev / install.sh
Last active August 25, 2018 20:03
Parity linux service
bash <(curl https://get.parity.io -Lk) -r stable
sudo wget -O /etc/systemd/system/parity-testnet-node.service https://gist.githubusercontent.com/Jonybang/688826f6aad76a623fcbf90507530d5d/raw/16968c87bcf54976c81e06e8b16007b14de139f3/parity-testnet-node.service
sudo systemctl daemon-reload
sudo systemctl enable parity-testnet-node.service
@MicrowaveDev
MicrowaveDev / install.sh
Last active August 25, 2018 19:58
Parity mac service
bash <(curl https://get.parity.io -Lk) -r stable
sudo wget -O /Library/LaunchDaemons/parity-testnet-node.plist https://gist.githubusercontent.com/Jonybang/b931ce8ed0dbcbdc7146bbb7d07f296f/raw/188b71dd907b8540090c6b401385292943ac08ff/parity-testnet-node.plist
sudo launchctl load -w /Library/LaunchDaemons/parity-testnet-node.plist
class ETH { }
class Galt { }
class Space { }
class Account { }
class DAO {
galtToken: Galt;
spaceToken: Space;
eth: ETH;
// Its your address with some Ethereum balance
const fromAddress = '0x062c6ebe692d0E31B79Eff9532F835bF0dbc1f45';
// Its private key of your address
const privateKey = '0x3a622a1c7504b6be1b77a6b12ac1438d50ada2906bd871b15aefd627aec872aa';
// Its your friend's wallet address
const toAddress = '0x6122a161c39907502B8BB4636215374389B95c6f';
// Its amount of eth, which you want to send to friend
const ethAmount = 0.01;
// Its your address with some Ethereum balance
const fromAddress = '0x062c6ebe692d0E31B79Eff9532F835bF0dbc1f45';
// Its your friend's wallet address
const toAddress = '0x6122a161c39907502B8BB4636215374389B95c6f';
// Its amount of eth, which you want to send to friend
const ethAmount = 0.01;
// Convert it to wei https://etherconverter.online/
const weiAmount = ethAmount * (10 ** 18);
pragma solidity 0.4.24;
contract SimpleVoting {
string public votingReason;
uint256 public votesToEnd;
mapping (address => bool) public alreadyVoted;
uint256 public votesForTrue;
uint256 public votesForFalse;
\x00\x00\x0c\x8c\x18\xf9\x25\x28\x30\xfb\x3c\x56\x47\x1c\x51\x33\x5a\x82\x62\xf1\x6a\x6d\x70\xe2\x76\x41\x7a\x7c\x7d\x89\x7f\x61\x7f\xff