Skip to content

Instantly share code, notes, and snippets.

@marianoeramirez
marianoeramirez / scam contract.sol
Created November 1, 2023 12:44
Scam contract offered on a youtube video.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
@marianoeramirez
marianoeramirez / main.rs
Last active May 22, 2023 18:27
Binence Rust
use binance::api::*;
use binance::futures::userstream::*;
use binance::futures::websockets::*;
use std::sync::atomic::{AtomicBool};
fn main() {
user_stream();
}
@marianoeramirez
marianoeramirez / project1.sol
Created November 16, 2022 19:13
Project1.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/* states
0 fundable
1 completed
*/
contract FundingProject{
enum State {Open, Closed}
def add_field(sender, object):
table_name = sender._meta.db_table
app = sender._meta.app_label
model = sender.__name__.lower()
if object.system:
field = get_model_field(sender, object)
if field is not None:
field.verbose_name = object.label
if field.null:
field.blank = not object.required
@marianoeramirez
marianoeramirez / image.py
Created June 12, 2017 15:16
Python image optimize command
import os, sys
from PIL import Image
import argparse
import time
import math
def convert_size(size_bytes):
if size_bytes == 0:
return "0B"
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
@marianoeramirez
marianoeramirez / gist:8ca50f2414728a6a1772
Created March 17, 2015 02:45
Upload a file Android
public static boolean uploadFile( String sourceFileUri, List<NameValuePair> params){
String fileName = sourceFileUri;
HttpURLConnection conn = null;
DataOutputStream dos = null;
String lineEnd = "\r\n";
String twoHyphens = "--";
String boundary = "*****";
int bytesRead, bytesAvailable, bufferSize;
@marianoeramirez
marianoeramirez / gist:b40488139a9f3b1a8c2c
Created March 14, 2015 00:00
Picasso Rounded upper corner
package com.fundarte.circuitoteatral;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;