Skip to content

Instantly share code, notes, and snippets.

View ssghost's full-sized avatar
🏠
Working from home

Stardust Song ssghost

🏠
Working from home
View GitHub Profile
library(tidyverse)
library(gganimate)
NUMPLAYERS = 45
ROUNDS = 5000
INITWEALTH = 45
#initialize the bank
#columns wealths of the NUMPLAYERS players
#rows show wealths of each of the ROUNDS ticks of the clocks
@ssghost
ssghost / Dockerfile
Created January 31, 2019 03:41 — forked from machinaut/Dockerfile
Demonstrating installing mujoco-py and gym[mujoco] on ubuntu 18.04
FROM ubuntu:18.04
# Install python and utils
RUN apt-get update && apt-get install -y python3-pip curl unzip \
libosmesa-dev libglew-dev patchelf libglfw3-dev
# Download mujoco
RUN curl https://www.roboti.us/download/mjpro150_linux.zip --output /tmp/mujoco.zip && \
mkdir -p /root/.mujoco && \
unzip /tmp/mujoco.zip -d /root/.mujoco && \
  • Working Memory 2.0: Earl K. Miller et al: Neuron
  • Perceptual Cycles: Ruin VanRullen: CellPress
  • Dynamics of Active Sensing and perceptual selection: Charles E Schroeder, et al: Current Opinion in Neurobiology
  • Shifting the spotlight of attention: evidence for discrete computations in cognition: Buschman and Miller: Frontiers in Human Neuroscience
  • A Dynamic Interplay within the Frontoparietal Network Underlies Rhythmic Spatial Attention: Fiebelkorn et al: Neuron
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@ssghost
ssghost / pure_html_css_modal.css
Created May 5, 2019 06:23 — forked from calebporzio/pure_html_css_modal.css
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
@ssghost
ssghost / ethereum-payment-metamask.html
Last active January 13, 2022 02:22 — forked from ksaitor/ethereum-payment-metamask.html
How to add Ethereum payments to your site with MetaMask
<div>
<button class="pay-button">Pay</button>
<div id="status"></div>
</div>
<script type="text/javascript">
window.addEventListener('load', async () => {
if (window.ethereum) {
window.web3 = new Web3(ethereum);
try {
await ethereum.enable();
@ssghost
ssghost / update-golang.md
Created February 9, 2022 20:20 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@ssghost
ssghost / SwiftChartPong.swift
Created July 11, 2022 00:30 — forked from dduan/SwiftChartPong.swift
Pong Game implemented with Swift Charts.
import SwiftUI
import Charts
import Combine
import Foundation
final class GameState: ObservableObject {
struct Player {
var position: Int
var halfSize: Int = 150
@ssghost
ssghost / cli.js
Created September 13, 2022 22:15 — forked from mattdesl/cli.js
colour palette from text prompt using Stable Diffusion https://twitter.com/mattdesl/status/1569457645182152705
/**
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts.
*
* Note that this uses an older fork of stable-diffusion
* with the 'txt2img.py' script, and that script was modified to
* support the --outfile command.
*/
var { spawn, exec } = require("child_process");
var path = require("path");
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
library Iterators {
// Function types:
// https://docs.soliditylang.org/en/latest/types.html#function-types
function map(uint256[] memory input, function (uint256) internal pure returns (uint256) f)
internal
pure