Skip to content

Instantly share code, notes, and snippets.

View josescasanova's full-sized avatar
:octocat:

jose josescasanova

:octocat:
View GitHub Profile
@NotoriousPyro
NotoriousPyro / BurnATAs.ts
Last active May 21, 2024 22:34
Burn your unwanted ATAs on Solana with this script
import { GetProgramAccountsFilter, PublicKey, TransactionMessage, VersionedTransaction } from "@solana/web3.js";
import { connection } from "../src/connection";
import config from "../src/lib/Config";
import { TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, createBurnCheckedInstruction, createCloseAccountInstruction, getAssociatedTokenAddressSync, unpackAccount, unpackMint } from "@solana/spl-token";
// Not really tested more than two but you can probably fit more in.
const maxMintsPerTx = 2;
// Replace this with your own keypair
const owningAccount = config.keypair;
// This creates a tx like this: https://solscan.io/tx/5PegaAnFzaEdVWYfzHFVTzJyZr8wHKRhijgtXyGhNzaQj4HfW5U8BqaaHNhGkCbZRDePns5cnFJAb18RCx4cuLqB
@NotoriousPyro
NotoriousPyro / connection-manager.ts
Created March 15, 2024 21:31
ConnectionManager Solana class for SexBot
import {
Instruction,
SwapInstructionsResponse
} from "@jup-ag/api";
import {
AddressLookupTableAccount,
ComputeBudgetProgram,
Connection,
Keypair,
PublicKey,
@druv5319
druv5319 / index.js
Created March 2, 2022 18:50
SendGrid Newsletter App
require('dotenv').config();
const sgMail = require('@sendgrid/mail');
const sgClient = require('@sendgrid/client');
const express = require('express')
const expressFileUpload = require('express-fileupload');
const app = express();
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
sgClient.setApiKey(process.env.SENDGRID_API_KEY);
app.use(express.urlencoded({
@josescasanova
josescasanova / fix-homebrew-npm.md
Created April 30, 2018 15:30 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@levelsio
levelsio / btc-eth-dca-buy.php
Last active January 6, 2023 22:04
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
BEARER='authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWlkIjoiQlUxMTEwMTAwMDAxMTAwODc0MSIsIm1haWQiOiJNQTExMTAxMDAwMDExMDA4NzM3Iiwic3ViZCI6InRlc3Rmb3JjZSIsInVzZXJfaWQiOiJhdXRoMHxCVTExMTAxMDAwMDExMDA4NzQxIiwiZW1haWwiOiJ0ZXN0Zm9yY2VAYml6b2RvLmNvbSIsIm5hbWUiOiJGb3JjZSBBd2FrZW5zIiwiaXNzIjoiaHR0cHM6Ly9zZWFtbGVzc2RvY3NkZXYuYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfEJVMTExMDEwMDAwMTEwMDg3NDEiLCJhdWQiOiJHRk54dWhSa0sweDRwbkVocmJSbzkzUDBCNDBBdlFmMyIsImV4cCI6MTQ4OTAyMzQ0MiwiaWF0IjoxNDg4OTg3NDQyfQ.DbcKYHvjp3GPM0hIO2vsScqJ7eXB26GWmkUUPMRVgVw'
USER_AGENT='user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'
# curl 'http://localhost:9000/selectors/forms/replace.json' -H 'origin: https://localhost:3000' -H 'accept-encoding: gzip, deflate, br' -H 'x-requested-with: XMLHttpRequest' -H 'accept-language: en-US,en;q=0.8' -H "$BEARER" -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://localhost:3000/ng/lobby' -H 'author
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active June 25, 2024 07:29
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

If you find the following useful my donation address is: aEgoFC75sP78gT55em1QYcL8DNYZ78ewJ5
1. Go here: https://console.aws.amazon.com/ec2sp/v1/spot/home?region=us-east-1
2. Click: "Request Spot Instances"
3. Request type: "Request and Maintain"
4. Choose how ever many servers/vcpus you want in the "Target Capacity" section.

Trying Flow on my node.js code…Let’s see how this goes

Finding the getting started guide:

  1. google flow
  2. click “getflow.com”
  3. was something else
  4. google flow javascript
  5. found flowtype.org
  6. Click “get started” and landed here https://flowtype.org/docs/getting-started.html#_

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.