Skip to content

Instantly share code, notes, and snippets.

View ex3ndr's full-sized avatar

Steve Korshakov ex3ndr

View GitHub Profile
@ex3ndr
ex3ndr / SmartWallet.sol
Created July 31, 2022 03:39
Smart Wallet Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "./modules/Crypto.sol";
contract SmartWallet {
struct Call {
address to;
uint256 value;
bytes data;
}
@ex3ndr
ex3ndr / cloudflare.sh
Created December 13, 2021 15:03 — forked from Manouchehri/cloudflare.sh
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@ex3ndr
ex3ndr / MakeAnimationsFast.kt
Created September 14, 2018 11:27
Hack that enables make render-thread based animations that will never stop even if ui thread is locked
package com.openland.react.anim.hack
import android.util.Log
import android.view.View
import android.view.ViewPropertyAnimator
import java.lang.reflect.Constructor
import java.lang.reflect.Field
object MakeAnimationsFast {
import Reconciler from 'react-reconciler';
var tagIndex = 0;
function createTag() {
return 't' + (tagIndex++);
}
const createReconciler = (onChanged: () => void) => Reconciler({
#!/bin/bash
IS_FAILING=`systemctl is-failed miner.service`
if [ "$IS_FAILING" == "active" ]; then
echo "ok"
else
echo failed
exit 2
fi
import sys
import os
added = set()
with open('include_framework/j2objc.h', 'w') as umbrella:
for root, directories, filenames in os.walk('include/'):
for filename in filenames:
if not filename.endswith(".h"):
continue
@ex3ndr
ex3ndr / UITableView+NoRegister.swift
Created September 27, 2015 20:59
Extension to UITableView that allows to avoid explict cell classes registrations
//
// Copyright (c) 2014-2015 Actor LLC. <https://actor.im>
//
import Foundation
// Cell automatic registration and dequeuing
private var registeredCells = "cells!"
@ex3ndr
ex3ndr / install_android_sdk
Created November 25, 2014 14:36
Installing Android SDK for build servers
cd /usr/local/
wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
tar xvf android-sdk_r23.0.2-linux.tgz
rm android-sdk_r23.0.2-linux.tgz
./android update sdk --no-ui --filter tools,platform-tools,build-tools-21.1.1,build-tools-21.1.0,build-tools-21.0.2,build-tools-21.0.1,build-tools-21.0.0,build-tools-20.0.0,build-tools-19.1.0,build-tools-19.0.3,build-tools-19.0.2,build-tools-19.0.1,build-tools-19.0.0,build-tools-18.1.1,build-tools-17.0.0,android-21,android-20,android-19,android-18,android-16,android-15,android-14,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository
@ex3ndr
ex3ndr / StickyFix.java
Created December 11, 2013 12:16
Android StickyHeaders padding temporary fix
package org.telegram.android.ui;
import android.content.Context;
import android.util.AttributeSet;
import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
/**
* Created by ex3ndr on 11.12.13.
*/
public class StickyFix extends StickyListHeadersListView {