-
Create a new file:
.ai/status/YYYY-MM-DD.md
-
Structure the update with sections:
- Development Steps
- Key Decisions
- Next Steps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from tronpy import Tron | |
import trontxsize | |
from tronpy.keys import PrivateKey | |
def get_bandwidth_price(): | |
url = "https://api.trongrid.io/wallet/getchainparameters" | |
response = requests.get(url) | |
data = response.json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION "public"."create_profile_on_signup"() RETURNS "trigger" | |
LANGUAGE "plpgsql" SECURITY DEFINER | |
AS $$begin | |
INSERT INTO public.profile (id) | |
VALUES ( | |
NEW.id | |
); | |
RETURN NEW; | |
end;$$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
id, | |
createClient, | |
CreateAccountError, | |
CreateTransferError, | |
TransferFlags, | |
} = require("tigerbeetle-node"); | |
console.log("Import ok!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################## | |
# Sample .aider.conf.yml | |
# This file lists *all* the valid configuration entries. | |
# Place in your home dir, or at the root of your git repo. | |
########################################################## | |
# Note: You can only put OpenAI and Anthropic API keys in the yaml | |
# config file. Keys for all APIs can be stored in a .env file | |
# https://aider.chat/docs/config/dotenv.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let imageBuffer = Buffer.from(body.profilePicture.split(',')[1], 'base64'); | |
console.log(imageBuffer); | |
Jimp.read(imageBuffer, function(err, image) { | |
if (err) { | |
context.done(err, | |
prepareErrorResponse(response, 'Unable to remove EXIF data from profile picture')); | |
} | |
console.log('before transform: ', image); | |
image = image.resize(400, 400).exifRotate((err, exifRotatedData) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
# Returns a random prime number with n bits | |
def generate_prime(n): | |
while True: | |
p = random.getrandbits(n) | |
if is_prime(p): | |
return p | |
# Returns the result of evaluating a polynomial with coefficients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TL;DR - jump to the challenge at the end | |
====ON BLOCKING EVIL BOTS===== | |
On a resent job interview I had for "Incapsula" a few days ago I was put to the challenge to break | |
their bot protection mechanism. Apparently node.js is not that common among bot writes and most bots | |
are not able to run javascript. | |
The challenge had two parts - | |
1. find what the code does. | |
2. implement a bot that will break the code without using js. | |
3. think how to make this code unbreakable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/btcsuite/btcd/txscript" | |
"github.com/btcsuite/btcutil" | |
) | |
func BuildMultiSigRedeemScript() (string, error) { | |
// you can use your wif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pools = await Utils.multiCall([...Array(parseInt(poolLength)).keys()].map(id => { | |
return { | |
pid: id.toString(), | |
poolInfo: new Web3EthContract(abi, masterChef).methods[poolInfoFunctionName](id), | |
}; | |
})); |
NewerOlder