This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------------------------- | |
@EventHandler( ignoreCancelled=true ) | |
public void onPlayerPickupCookie( PlayerPickupItemEvent event ) { | |
ItemStack item = event.getItem().getItemStack(); | |
if( item.getType() == Material.COOKIE ) { | |
if( !item.hasItemMeta() ) return; | |
if( !item.getItemMeta().hasDisplayName() ) return; | |
if( item.getItemMeta().getDisplayName().equals( "Pinata Candy" ) ) { | |
if( event.getPlayer().getInventory().contains( item ) ) { | |
event.setCancelled( true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// read element text with converted line breaks | |
function readText( element ) { | |
// invisible "workspace" element | |
mb = $('#magicbox'); | |
// copy over the html, with replaced <br> tags | |
var content = $(element).html(); | |
content = content.replace( /<br>/g, '[[br]]' ); | |
mb.html( content ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// Smart linked list. | |
namespace Util { | |
template <class T> class SLinkedList; | |
/// --------------------------------------------------------------------------- | |
/// Defines the links in an object. Objects added to a SLinkedList must |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
-- WIN64 LUA buildscript. | |
-- Keep in mind that the working directory is /build/. | |
------------------------------------------------------------------------------- | |
-- Directory tree w/ outputs: | |
-- src Source files. | |
-- projects/library MSVC project files for building lua53.lib. | |
-- projects/interpreter MSVC project files for building lua.exe. | |
-- projects/compiler MSVC project files for building luac.exe. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adder.go | |
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
"github.com/danishm/andornot/gates" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test code { | |
with a tab | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// passhash.go | |
// * Argon2id password hashing. | |
// | |
// Copyright 2022 Mukunda Johnson | |
// | |
// Redistribution and use in source and binary forms, with or without modification, are | |
// permitted provided that the following conditions are met: | |
// | |
// 1. Redistributions of source code must retain the above copyright notice, this list of | |
// conditions and the following disclaimer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, uuid, json, os, time | |
DREAMHOST_KEY = '<dreamhost API key>'; | |
#---------------------------------------------------------------------------------------- | |
def dh_request( **kwargs ): | |
params = kwargs | |
params["key"] = DREAMHOST_KEY | |
params["unique_id"] = str(uuid.uuid4()) | |
params["format"] = "json" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Test } from "@nestjs/testing"; | |
import { Controller, INestApplication, Post, UseGuards } from "@nestjs/common"; | |
import * as supertest from "supertest"; | |
import { Throttle, ThrottlerGuard, ThrottlerModule } from "@nestjs/throttler"; | |
@Controller('test/throttle') | |
class ThrottleTestController { | |
@UseGuards(ThrottlerGuard) | |
@Throttle({ default: { limit: 1, ttl: 1000 } }) |