Skip to content

Instantly share code, notes, and snippets.

@jindrichmynarz
jindrichmynarz / dub_techno_in_sonic_pi.rb
Created December 8, 2015 19:11
Dub techno in Sonic Pi
use_debug false
use_bpm 130
# Our mixer!
master = (ramp *range(0, 1, 0.01))
kick_volume = 1
bass_volume = 1
revbass_volume = 1
snare_volume = 0.5
hats_volume = 0.5
@mondain
mondain / public-stun-list.txt
Last active April 22, 2024 08:55
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@jkachmar
jkachmar / 1README.md
Last active December 24, 2021 15:06
Small Docker images with Alpine, Haskell, and Stack

All actions should be performed in the root directory of a Haskell project that uses stack. The following lines should be present in the project's stack.yaml file:

docker:
  enable: true

Additionally, the BaseImage and Dockerfile files from this gist should also be present in the project's root directory.

@rbnpi
rbnpi / ReadMe.md
Last active October 17, 2023 04:12
Beethoven Moonlight Sonata played by Sonic Pi. Uses Sonatina Symphonic Orchestra samples. See readme for availablilty. Video at https://youtu.be/8rdJ9wxGw5Y

The Sonic Pi file moonlightSonata-RF.rb which plays Beethoven's Moonlight Sonata 1st Movement requires the use of the Grand Piano samples from the Sonatina Symphonic Orchestra produced by Matthias Westlund.

Unfortunately this is no longer available from his website https://sso.mattiaswestlund.net/ However there is an alternative available at https://github.com/peastman/sso from where you can download the library. It is coverd by a https://creativecommons.org/licenses/sampling+/1.0/ Download and expand on your Desktop, or other suitable location and then set the link in the program at line 9 appropraitely for your installation.

The file should be run using the run_file "/path/to/file/location" command as it is too long to run from a Sonic Pi buffer.

An alternative version using the built in piano synth in Sonic Pi is included for comparison.

Multi.new()
|> Multi.insert(:item_without_hash_id, changeset)
|> Multi.run(:playlist, fn _repo, %{item_without_hash_id: playlist} ->
playlist
|> Playlist.changeset_generate_hash_id()
|> Repo.update()
end)
# iterate over the localized_titles and add to db
# pass in playlist that was just inserted
|> Multi.run(:add_localized_titles, fn _repo, %{playlist: playlist} ->
// contracts/GameItems.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract GameItems is ERC1155, Ownable {
@thetwosents
thetwosents / @strongstart-core
Last active January 6, 2022 05:13
Javascript core file for the StrongStart platform
/*
package_name: @strongstart/core
contribute_email: jon@strongstart.io
author: Jon Senterfitt
owned_by: StrongStart
version: 1.0.0
description: StrongStart Core Library
documentation:
@dabit3
dabit3 / marketplace.sol
Last active March 14, 2024 15:55
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {
@shobhitic
shobhitic / ABToken.sol
Last active January 5, 2023 20:08
Soulbound tokens or Account Bound Tokens - https://youtu.be/_6Zt70PZbAs
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./EIP4973.sol";
contract ABT is ERC4973 {
address public owner;
uint256 public count = 0;
constructor () ERC4973("MyToken", "MTK") {