Skip to content

Instantly share code, notes, and snippets.

@axic
axic / ERC20SafeTransfer.sol
Last active January 26, 2019 03:05
Safe transfer workaround for not fully ERC20 compatible tokens.
/*
* WARNING: Proof of concept. Do not use in production. No warranty.
*
* Safe transfer workaround for not fully ERC20 compatible tokens.
* Well, ERC20 had a lot of revision, who I am to say something is not compatible :)
*
* Read the following for more explanation: https://github.com/ethereum/solidity/issues/4116
*
* In short:
* The final ERC20 standard (IIRC) requires the transfer function to return a boolean. Some tokens do not return anything
//* Full credits and appreciation to The Rational Flibbr Indicators Creator
//* flibbr : flibbr.com : @flibbr
//* Consider tipping flibbr
study(title="The Rational Flibbr Indicator v2", shorttitle="The Rational Flibbr Indicator v2")
//Inputs
useCustomTick = input(false, title="Custom ticker? [Y/N]", confirm=true)
tickCustom = input(title="Symbol [e.g. BTCCNY:HUOBI]", type=string, defval="")
@plentz
plentz / nginx.conf
Last active May 10, 2024 03:20
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@electronut
electronut / attiny84-hcsr04.c
Created June 7, 2013 15:37
Talking to ultrasonic sensor HC-SR04 with an ATtiny84, and sending distance data using serial communications.
//
// Talking to ultrasonic sensor HC-SR04 with an ATtiny84, and
// sending distance data using serial communications.
//
// electronut.in
//
#include <avr/io.h>
#include <string.h>
#include <util/delay.h>
@securitytube
securitytube / ssid-sniffer-scapy-python.py
Created April 2, 2013 12:49
WLAN SSID Sniffer in Python using Scapy
#!/usr/bin/env python
from scapy.all import *
ap_list = []
def PacketHandler(pkt) :
if pkt.haslayer(Dot11) :
if pkt.type == 0 and pkt.subtype == 8 :