Skip to content

Instantly share code, notes, and snippets.

View bhgames's full-sized avatar

Jordan Prince bhgames

View GitHub Profile
#[repr(C)]
#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug, Clone)]
pub enum CollectionStatus {
Unverified,
Verified,
CollectionMasterEdition,
}
#[repr(C)]
const Arweave = require('arweave');
const fs = require('fs');
const fcn = async () => {
const arweaveConnection = Arweave.init({
host: 'arweave.net', // Hostname or IP address for a Arweave host
port: 443, // Port
protocol: 'https', // Network protocol http or https
timeout: 20000, // Network request timeouts in milliseconds
logging: true, // Enable network request logging
});
@bhgames
bhgames / escrow_update.md
Created March 22, 2021 18:02
Escrow Update

There is an issue in the release_escrow command of V1 of escrow:

pub fn release_escrow(program_id: &Pubkey, accounts: &[AccountInfo], amount: u64) -> ProgramResult {
    let account_info_iter = &mut accounts.iter();
    let source = next_account_info(account_info_iter)?;
    let destination = next_account_info(account_info_iter)?;
    let authority = next_account_info(account_info_iter)?;
    let token_program = next_account_info(account_info_iter)?;
@bhgames
bhgames / Output of Cloudwatch Alarm
Created November 14, 2017 13:40
Output of Cloudwatch Alarm
data.template_file.container_def: Refreshing state...
data.template_file.container_def: Refreshing state...
data.template_file.container_def: Refreshing state...
data.template_file.additional_port_mappings: Refreshing state...
data.template_file.additional_port_mappings: Refreshing state...
data.template_file.container_def: Refreshing state...
data.template_file.port_mappings: Refreshing state...
data.template_file.env_vars[0]: Refreshing state...
data.template_file.env_vars[1]: Refreshing state...
data.template_file.port_mappings: Refreshing state...
@bhgames
bhgames / run_test.rb
Last active December 12, 2015 08:18
How to install TestUnit into a Cramp app
#1. create test directory at project level
#2. Create unit directory in test.
#3. Put this file, base_test.rb in test/units directory.
#Then run ruby -Itest test/unit/any_test.rb
#As long as any_test extends this BaseTest class.
#If you want to run specific tests
# ruby -Itest test/unit/any_test.rb -n test_specific_test_name
#Also, if you want to do something like fixtures, create a module called "RakeTasks"
#(rake_tasks.rb) in your lib directory. You can include methods to populate models in the
subscrpt.current_delivery_address = curraddr
subscrpt.subscrpt_type = SubscrptType.find(:first, :conditions => {:id => i.subscrpt_type_id})
subscrpt.subscrpt_terms = SubscrptTerms.find(:first, :conditions => {:id => i.subscrpt_terms_id})
subscrpt.save
@user.subscrpts<<subscrpt
Bhviewer::Application.routes.draw do |map|
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
<% unless cart.line_items.empty? %>
<div class = "cart_title">Your Cart</div>
<table>
<%= render(cart.line_items)%>
<tr class="total_line">
<td colspan="2">Total</td>
<td class="total_cell"><%= number_to_currency(cart.total_price) %></td>
</tr>
class LineItemsController < ApplicationController
# GET /line_items
# GET /line_items.xml
def index
@line_items = LineItem.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @line_items }
end