Skip to content

Instantly share code, notes, and snippets.

View 256hax's full-sized avatar

256hax 256hax

View GitHub Profile
@dabit3
dabit3 / App.js
Last active January 29, 2024 04:42
Working example of Solana and Anchor on JavaScript Client - React
import './App.css';
import { useEffect } from 'react';
import {
Program,
Provider,
BN,
web3,
} from '@project-serum/anchor'
import {
Connection,
@h4rkl
h4rkl / harkl.js
Last active July 11, 2022 08:19
Can't get the correct signing authority for solana serum anchor implementation
const anchor = require("@project-serum/anchor");
const serumCmn = require("@project-serum/common");
const { TOKEN_PROGRAM_ID } = require("@solana/spl-token");
describe("harkl-tests", () => {
// Configure the client to use the local cluster.
anchor.setProvider(anchor.Provider.env());
const program = anchor.workspace.Harkl;
@aalbertson
aalbertson / gist:e2f3a63ff92800a16c6251de0a0a1f85
Created February 5, 2019 19:52
example disable audio - vagrant mac virtualbox v2 config
$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.define "LogsParsing"
config.vm.network "forwarded_port", guest: 8080, host: 8080, auto_correct: true
config.vm.provision :file, source: './provision.sh', destination: '~/provision.sh'
config.vm.provision "shell", run: 'always', path: "./provision.sh", privileged: false
@xnau
xnau / wp-locale-conversion-array.php
Created February 1, 2019 19:56
Conversion array for WordPress locale codes and standard language codes and names
<?php
$wp_locale_conversion = array(
'af' => array(
'name' => 'Afrikaans',
'code' => 'af',
'wp_locale' => 'af'
) ,
'ak' => array(
'name' => 'Akan',
'code' => 'ak',
@adamgavlak
adamgavlak / dokku.sh
Created December 1, 2018 11:20
Basic dokku installation
# Create a Dokku app and addons
#------------------------------
## Go to http://SERVER_IP and add a IP address (if you don't it seems to go weird: use a junk one if needed)
dokku apps:create APP_NAME
## Add postgresql and link it to the application
dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
dokku postgres:create APP_NAME-db
dokku postgres:link APP_NAME-db APP_NAME
@joshteng
joshteng / dokku_setup.md
Last active May 12, 2022 14:38
Using Dokku to deploy a Rails Application

#Goal Deploy your Rails App super easily with Dokku on Digital Ocean cheap cheap!

##Notes

  • Follow 12 factor design (include the rails_12factor gem)
  • Don't forget your Procfile with the command to start up your application server
  • I prefer using external hosted logging services like Logentries (not in this guide)
  • Set up performance monitoring AppSignal or New Relic (not in this guide)
@fatnic
fatnic / all-in-one.rb
Created December 28, 2011 18:50
One file images in Sinatra
require "sinatra"
require "base64"
get "/" do
erb :index
end
get "/images/:img" do
case params['img']