Skip to content

Instantly share code, notes, and snippets.

View stevyhacker's full-sized avatar
💻

Stevan Bogosavljević stevyhacker

💻
View GitHub Profile
{
"name": "Token List",
"logoURI": "https://ethereum-optimism.github.io/optimism.svg",
"keywords": [
"scaling",
"layer2",
"infrastructure"
],
"timestamp": "2023-11-13T15:57:32.493Z",
"tokens": [
@stevyhacker
stevyhacker / snapshot.js
Created June 16, 2022 22:49
NFT holders snapshot tool
import fetch from 'node-fetch';
import fs from 'fs';
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
const apiKey = "INSERT_YOUR_OWN_API_KEY_HERE"

Keybase proof

I hereby claim:

  • I am stevyhacker on github.
  • I am stevyhacker (https://keybase.io/stevyhacker) on keybase.
  • I have a public key ASDdAbtSOnhGPvOjhHZ4uxKqbP6Kowe9gWMMqCabRfpHvAo

To claim this, I am signing this object:

@stevyhacker
stevyhacker / NetworkChecker.kt
Created October 12, 2020 09:52
Checking internet connectivity on Android
package com.infinum.onboarding.weatherapp.utils
import timber.log.Timber
import java.io.IOException
import java.net.InetSocketAddress
import java.net.Socket
import java.net.SocketAddress
class NetworkChecker {
@stevyhacker
stevyhacker / fix_github_https_repo.sh
Created April 21, 2018 18:10 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@stevyhacker
stevyhacker / NKtoken.sol
Created January 17, 2018 14:57 — forked from anonymous/NKtoken.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.20-nightly.2018.1.11+commit.c20b6da.js&optimize=true&gist=
pragma solidity ^0.4.4;
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
@stevyhacker
stevyhacker / collection.js
Created January 4, 2016 17:19
FreeCode Camp record collection checkpoint
// Setup
var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
@stevyhacker
stevyhacker / NizoviCas2SelectionSort.java
Created November 29, 2015 22:15
Selection sort in java
public class NizoviCas2SelectionSort {
public static void stampajNiz(int[] a) {
for (int i = 0; i < a.length; i++) {
System.out.print(a[i] + " ");
}
}
// vraća indeks najmanjeg elementa u dijelu niza a [ind...n

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1