Skip to content

Instantly share code, notes, and snippets.

View samizdat-shell-help.bash
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@calebsander
calebsander / base64.wast
Created Jul 17, 2018
base-64 encode and decode in WASM
View base64.wast
(module
;; Memory layout
;; 0 - 63: lookup
;; 64 - 186: revLookup
;; 187 - : input, followed by output
(global $INPUT (export "INPUT") i32 (i32.const 187))
(memory (export "memory") 1)
(data (i32.const 0) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
(func (export "init")
(local $i i32)
@axic
axic / README.md
Last active Apr 24, 2020
ewasm “WRC20” token contract coding challenge
View README.md

ewasm “WRC20” token contract coding challenge

This document describes a simple contract in pseudocode and gives a couple of test cases for it.

The challenge is designed to be fairly easy to implement in a language of choice, compiled to wasm and interacted with. It is loosely based on the ERC20 token standard, named "WRC20", where the W stands for WebAssembly.

External interface

The contract has two features:

View rc5.wast
(module
(global $gasUsed (mut i64) (i64.const 0))
(func $useGas (param $gas i64)
get_global $gasUsed
get_local $gas
i64.add
set_global $gasUsed
)
(global $cb_dest (mut i32) (i32.const 0))
@tilkinsc
tilkinsc / load_dds.c
Last active Nov 6, 2020
C OpenGL DDS Loading Tutorial
View load_dds.c
/*
Can load easier and more indepth with https://github.com/Hydroque/DDSLoader
Because a lot of crappy, weird DDS file loader files were found online. The resources are actually VERY VERY limited.
Written in C, can very easily port to C++ through casting mallocs (ensure your imports are correct), goto can be replaced.
https://www.gamedev.net/forums/topic/637377-loading-dds-textures-in-opengl-black-texture-showing/
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/
^ Two examples of terrible code
@reborg
reborg / rich-already-answered-that.md
Last active Nov 23, 2020
A curated collection of answers that Rich gave throughout the history of Clojure
View rich-already-answered-that.md

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

View Uninstall_brew_package_and_dependencies.md

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

View script.cpp
Script::Script() {
}
Script::~Script() {
}
void Script::Initialize(char* src) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
View scriptsystem.cpp
#include <eternity.hpp>
ScriptSystem::ScriptSystem() {
m_platform = 0;
m_isolate = 0;
m_scriptableCount = 0;
m_scriptablePoolSize = 0;
m_scriptables = 0;
}
@frekele
frekele / Jenkinsfile
Created Aug 4, 2016
Jenkinsfile pipelineTriggers - TimerTrigger periodic run the aws-update-my-dynamic-ip.sh script.
View Jenkinsfile
#!groovy
MAIL_FROM = 'noreply-jenkins@myhost.io'
MAIL_TO = 'jenkins@myhost.io'
GITHUB_PROTOCOL = 'https'
GITHUB_USER_NAME = 'my-github-user'
GITHUB_USER_EMAIL = 'jenkins@myhost.io'
GITHUB_REPO = 'github.com/my-user/my-repository'
GITHUB_PROJECT_URL = "${GITHUB_PROTOCOL}://${GITHUB_REPO}"
You can’t perform that action at this time.