Skip to content

Instantly share code, notes, and snippets.

View libertylocked's full-sized avatar

libertylocked

View GitHub Profile
@libertylocked
libertylocked / ad-astra-no-meteor.js
Created November 21, 2023 05:11
disable ad astra meteor spawns in overworld with kubejs server script
if (Platform.getMods().containsKey('ad_astra')) {
ServerEvents.tags('worldgen/biome', (e) => {
e.removeAll('ad_astra:has_structure/meteor_biomes');
});
}
@libertylocked
libertylocked / adastra-fixes.js
Last active November 21, 2023 05:10
kubejs script to fix recipes in Ad Astra mod
// Recipe fixes for Ad Astra.
(() => {
const MOD_NAME = 'ad_astra';
const SUPPORTED_VERSION = '1.15.4';
if (Platform.getMods().containsKey(MOD_NAME) &&
Platform.getMods().get(MOD_NAME).getVersion() == SUPPORTED_VERSION) {
console.log('Applying fixes');
setup();
} else {
@libertylocked
libertylocked / cluttered-fixes.js
Last active November 19, 2023 08:28
KubeJS server script to fix all recipe conflicts in Cluttered mod
// Recipe fixes for Cluttered.
(() => {
const MOD_NAME = "luphieclutteredmod";
const SUPPORTED_VERSION = "2.1";
if (Platform.getMods().containsKey(MOD_NAME) &&
Platform.getMods().get(MOD_NAME).getVersion() == SUPPORTED_VERSION) {
console.log("Applying fixes");
setup();
} else {
@libertylocked
libertylocked / open-folder-in-code-oss.nemo_action
Created September 12, 2019 07:46
Open folder in Code - OSS
[Nemo Action]
Name=Open folder in Code - OSS
Comment=Open current folder in Code - OSS
Icon-Name=vscode
Selection=any
Extensions=any
EscapeSpaces=true
Exec=/bin/sh -c "cd %P && code ."
Dependencies=code;
@libertylocked
libertylocked / npm-nvm.sh
Last active August 14, 2018 16:46
npm-nvm.sh - run npm using a node version specified in nvmrc.
#!/bin/sh
# This script runs NPM using a version of node specified in nvmrc
# npm-nvm.sh <command>
# Examples:
# - npm-nvm.sh install
# - npm-nvm.sh run build
NPM_PREFIX=$(npm config get prefix)
npm config delete prefix
/**
* A multisig wallet leveraging offchain communication channels
* to send signatures around that the owners don't have to
* pay any gas in the process. Only the recipient pays gas.
*/
pragma solidity ^0.4.18;
contract Multisig {
event LogMoneySent(address to, uint amount);
@libertylocked
libertylocked / MixingOTP.sol
Last active November 30, 2017 19:42
mixing contract using one time pad with an operator
/**
* A mixing contract using one time pad
* Do not copy this code as it is not tested or audited.
*/
pragma solidity 0.4.18;
contract MixingOTP {
address operator;
mapping(address => bool) payers;
mapping(address => bool) paid;
@libertylocked
libertylocked / MixingBasic.sol
Last active November 29, 2017 20:17
Basic payment mixing contract
/**
* Basic payment mixing contract
* Do not copy this contract! It's never been tested or audited
* It also lacks a withdraw function for payers
*/
pragma solidity 0.4.18;
contract MixingBasic {
address owner;
uint public amount;
pragma solidity 0.4.15;
contract RemittanceManager {
struct Remittance {
address funder;
address collector;
uint amount;
bytes32 combinedPassword;
}
'use strict'
function* fibGen(limit) {
let prevVal = 0, currVal = 1;
let nextVal = 0;
while (!limit || currVal <= limit) {
yield currVal;
nextVal = currVal + prevVal;
prevVal = currVal;
currVal = nextVal;