Skip to content

Instantly share code, notes, and snippets.

AnrDaemon

Block or report user

Report or block AnrDaemon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Fix ExU ingots uncraftable on dedicated servers
# fixing ExU Ingot Recipes when TCon, DragonAPI is installed
# Credits to PrincessRTFM
val stableSigil = <ExtraUtilities:divisionSigil>.onlyWithTag({stable: 1});
val normalSigil = <ExtraUtilities:divisionSigil>;
val ironIngot = <minecraft:iron_ingot>;
val diamond = <minecraft:diamond>;
recipes.removeShaped(<ExtraUtilities:unstableingot>); # remove the bugged recipes
recipes.addShaped(<ExtraUtilities:unstableingot:2>,[[ironIngot],[stableSigil],[diamond]]);
View git-hub.sh
#!/bin/sh
_tmp="$( mktemp --tmpdir -- git-hub.XXXXXXXX )"
trap 'rm "$_tmp";' EXIT HUP INT ABRT TERM
curl -s "https://api.github.com/repos/$1" > "$_tmp" || exit 1
jq . >> /dev/null < "$_tmp" || {
echo "Malformed JSON."
exit 1
View Repo-Entity.php
<?php
final class Repository
{
public save(Entity $item) {}
public find($criteria): Entity {}
public __construct(PDO $db) {}
}
final class Entity
View fancyprompt.sh
__set_prompt()
{
test "$PS_ORIG" || PS_ORIG="$PS1"
test "$PC_ORIG" || eval "PC_ORIG='$PROMPT_COMMAND'"
PROMPT_COMMAND=__bash_prompt
}; readonly -f __set_prompt
__bash_prompt()
{
local ERRORLEVEL=$?
if [ $ERRORLEVEL != 0 ]; then
View new.php
<?php
function get_new_image_name($dir, $id, $limit_num = PHP_INT_MAX)
{
$cache = [];
foreach(glob($dir . sprintf('/%02u-*.*', $id), GLOB_MARK) as $name)
{
if(is_dir($name))
{
continue;
}
View htc-auto-bashfiles.hrc
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hrc PUBLIC
"-//Cail Lomecb//DTD Colorer HRC take5//EN"
"http://colorer.sf.net/2003/hrc.dtd"
>
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd"
>
View ractphp-example.php
<?php
require_once __DIR__.'/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$factory = new React\Datagram\Factory($loop);
function serverHandler(React\Datagram\Socket $server) {
$server->on('message', 'messageHandler');
View classloader.php
<?php
/** Universal stackable classloader.
*
* @version SVN: $Id: classloader.php 739 2018-03-03 19:05:12Z anrdaemon $
*/
namespace AnrDaemon;
return call_user_func(function(){
$nsl = strlen(__NAMESPACE__);
View nf.php
<?php
$nf = new \NumberFormatter("ru_RU", \NumberFormatter::CURRENCY);
$cs = ini_get('default_charset');
$formatter = function($price, $currency = 'RUB')
use($nf, $cs)
{
return iconv('UTF-8', "$cs//IGNORE", $nf->formatCurrency($price, $currency));
};
View SmartyWrapper.php
<?php
/** Smarty template wrapper
*
* @version $Id: Smarty.php 674 2017-07-10 23:47:11Z anrdaemon $
*/
namespace AnrDaemon\CcWeb\Wrappers;
use
AnrDaemon\CcWeb\Interfaces;
You can’t perform that action at this time.