Skip to content

Instantly share code, notes, and snippets.

@waylandc
waylandc / emacs-tip.el
Created March 5, 2020 10:45
my collection of emacs tips
;; collection of tips I've found on the net for me to copy and paste from in one place
;; to format a region of code
;; make sure your in correct mode for appropriate formatting
;; i.e. M-x c-mode
C-x h (M-x mark-whole-buffer)
C-M-\ (M-x indent-region)
;; shutdown the emacs daemon
@waylandc
waylandc / query-substrate-block-data.js
Last active March 5, 2020 03:06
query past event info from previous substrate blocks
// using polkadot.js api this code will retrieve events from blocks 0-50
// you can go as far back on full archive nodes and about 150-200 blocks
// back on non-archive nodes
// code contributed from Stefie@riot https://github.com/polkadot-js/api/issues/578
for(i=50;i>=0;i--){
var hash = await api.rpc.chain.getBlockHash(i);
var events = await api.query.system.events.at(hash);
console.log(`\n #${i} Received ${events.length} events:`);
@waylandc
waylandc / rust.nix
Created August 19, 2019 11:16
nix-shell config for rust/substrate development on macos
let
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
myrust = (nixpkgs.rustChannelOf { date = "2019-05-21"; channel = "nightly"; }).rust.override { extensions = [ "rust-src" "rust-analysis" "rustfmt-preview" ]; targets = [ "wasm32-unknown-unknown" ];};
in
with nixpkgs;
stdenv.mkDerivation {
name = "rust-dev";
buildInputs = [
myrust
in stdenv.mkDerivation rec {
name = "godot-${version}";
version = "3.1";
src = fetchFromGitHub {
owner = "godotengine";
repo = "godot";
rev = "${version}-stable";
sha256 = "1z37znqzbn0x8s04pb9dxzni9jzl8m59nfrr14vypww42f9l5i7i";
};
import React, { Component } from 'react';
import { Button, FormGroup, FormControl, ControlLabel } from 'react-bootstrap';
import Axios from 'axios';
import './Login.css';
export default class Login extends Component {
constructor(props) {
super(props);
this.state = {