Skip to content

Instantly share code, notes, and snippets.

@ljlabs
ljlabs / tinker_board_2.js
Last active March 31, 2023 06:44
top 10 raspberry pi alternatives
document.write('<link rel="stylesheet" href="https://github.githubassets.com/assets/gist-embed-aa244c59879c.css">')
document.write('<a href="https://www.amazon.com/Rockchip-Computer-Bluetooth-Connectivity-Dual-Display/dp/B08V4B9TG9?crid=2YHWL521VPQRX&keywords=ASUS+SBC+Tinker+board+RK3288&qid=1680244130&sprefix=asus+sbc+tinker+board+rk3288%2Caps%2C151&sr=8-6&linkCode=li2&tag=jordaan0-20&linkId=b7d618a677fcb041c9e7c04f4b54a4a8&language=en_US&ref_=as_li_ss_il" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B08V4B9TG9&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=jordaan0–20&language=en_US" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=jordaan0-20&language=en_US&l=li2&o=1&a=B08V4B9TG9" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />\n')
@ljlabs
ljlabs / IUniswapV2Callee.sol
Last active September 22, 2022 07:17
Uniswap Flashloan
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
@ljlabs
ljlabs / ScanForNewsAndTweet.json
Last active September 14, 2022 07:13
workflowEngine-CF config file to create a news tweeting bot
{
"root": {
"node": "RepetitiveWIthDelay",
"sleep_duration": 3600,
"next_steps": [{
"node": "HttpGetRequest",
"url": "https://newsdata.io/api/1/news?apikey=YOUR_API_KEY&country=us,gb&language=en&q=cryptocurrency",
"next_steps": [{
"node": "tweet",
"credentials": {
{
"string_id": "THE ID OF THE STRING NEEDED",
...
}
@ljlabs
ljlabs / getPriceOfEthInUSDC.py
Last active August 11, 2022 18:29
This script will print the price of ETH in USDC on the Sushi Swap DEX on the polygon network
from web3 import Web3
infura_url = 'https://polygon-rpc.com'
web3 = Web3(Web3.HTTPProvider(infura_url))
abi = [{"constant": True, "inputs": [], "name": "getReserves",
"outputs": [{"internalType": "uint112", "name": "_reserve0",
"type": "uint112"},
{"internalType": "uint112", "name": "_reserve1",
@ljlabs
ljlabs / api-skeleton.py
Last active May 11, 2018 12:24
tangle pow explanation
import hashlib
import json
from textwrap import dedent
from time import time
from uuid import uuid4
from tangle import Tangle
from urllib.parse import urlparse
import requests
from flask import Flask, jsonify, request
@ljlabs
ljlabs / Standard Bank IT Challenge 2015 setup
Created April 15, 2016 12:03 — forked from bliz937/Standard Bank IT Challenge 2015 setup
The setup script I used for SBITC 2015
#!/bin/bash
SDK=http://172.16.38.38/iso/OtherStuff/Java/jdk-8u45-linux-x64.gz
PY2=http://172.16.38.38/iso/OtherStuff/Python/Python-2.7.6.tgz
PY3=http://172.16.38.38/iso/OtherStuff/Python/Python-3.4.0.tgz
SUBL=http://172.16.38.38/iso/OtherStuff/Sublime/Sublime%20Text%202.0.2%20x64.tar.bz2
ECLIPSE=http://172.16.38.38/iso/OtherStuff/Eclipse/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz
cd /tmp/